/**
 * Dataplex Trial Signup Form Styles
 *
 * Design matches dataplex-consulting.com:
 * - Light gray background (#f5f5f7)
 * - Purple accent (#7c5cff)
 * - White cards with subtle shadows
 * - Modern sans-serif typography
 */

:root {
    --bg-color: #f5f5f7;
    --accent-color: #7c5cff;
    --accent-hover: #6a4de6;
    --accent-light: rgba(124, 92, 255, 0.05);
    --card-bg: #ffffff;
    --text-primary: #1d1d1f;
    --text-secondary: #6e6e73;
    --text-muted: #86868b;
    --border-color: #d2d2d7;
    --border-focus: #7c5cff;
    --error-color: #ff3b30;
    --success-color: #34c759;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 24px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 8px;
    --radius-xs: 6px;
    --font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
}

/* Reset and base styles */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

/* Container */
.container {
    max-width: 560px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 32px;
}

header a {
    display: inline-block;
}

.logo {
    height: 40px;
    width: auto;
    transition: opacity 0.2s;
}

.logo:hover {
    opacity: 0.8;
}

/* Main card */
.card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 40px;
    box-shadow: var(--shadow-md);
}

/* Typography */
h1 {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 8px;
    text-align: center;
    letter-spacing: -0.02em;
}

.accent {
    color: var(--accent-color);
}

.subtitle {
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 32px;
    font-size: 15px;
}

/* Form groups */
.form-group {
    margin-bottom: 24px;
}

label {
    display: block;
    font-weight: 500;
    margin-bottom: 8px;
    font-size: 14px;
    color: var(--text-primary);
}

.required {
    color: var(--error-color);
}

.hint,
.hint-inline {
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 400;
}

.hint {
    display: block;
    margin-top: 6px;
}

/* Form inputs */
input[type="text"],
input[type="email"],
select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 16px;
    font-family: var(--font-family);
    color: var(--text-primary);
    background: var(--card-bg);
    transition: border-color 0.2s, box-shadow 0.2s;
}

input[type="text"]::placeholder,
input[type="email"]::placeholder {
    color: var(--text-muted);
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.1);
}

input:invalid:not(:placeholder-shown) {
    border-color: var(--error-color);
}

select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236e6e73' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

/* Product selection grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.product-option {
    cursor: pointer;
    display: block;
}

.product-option input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.product-card {
    display: flex;
    flex-direction: column;
    padding: 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
    background: var(--card-bg);
}

.product-option input:checked + .product-card {
    border-color: var(--accent-color);
    background: var(--accent-light);
}

.product-option:hover .product-card {
    border-color: var(--accent-color);
}

.product-option input:focus + .product-card {
    box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.1);
}

.product-option input:disabled + .product-card {
    opacity: 0.5;
    cursor: not-allowed;
}

.product-name {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.product-desc {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Honeypot - hidden from humans */
.honeypot {
    position: absolute !important;
    left: -9999px !important;
    top: -9999px !important;
    opacity: 0 !important;
    height: 0 !important;
    width: 0 !important;
    pointer-events: none !important;
}

/* Turnstile widget */
.cf-turnstile {
    margin: 24px 0;
    display: flex;
    justify-content: center;
}

/* Submit button */
.submit-btn {
    width: 100%;
    padding: 16px 24px;
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 16px;
    font-weight: 600;
    font-family: var(--font-family);
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.submit-btn:hover:not(:disabled) {
    background: var(--accent-hover);
}

.submit-btn:active:not(:disabled) {
    transform: scale(0.98);
}

.submit-btn:disabled {
    background: var(--text-secondary);
    cursor: not-allowed;
}

.btn-loading {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Loading spinner */
.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Processing note */
.processing-note {
    margin-top: 12px;
    font-size: 13px;
    color: var(--text-muted);
    text-align: center;
    font-style: italic;
}

/* Terms text */
.terms {
    margin-top: 16px;
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
    line-height: 1.5;
}

.terms a {
    color: var(--accent-color);
    text-decoration: none;
}

.terms a:hover {
    text-decoration: underline;
}

/* Skip trial link */
.skip-trial {
    margin-top: 20px;
    font-size: 14px;
    color: var(--text-secondary);
    text-align: center;
}

.skip-trial a {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 500;
}

.skip-trial a:hover {
    text-decoration: underline;
}

/* Error message */
.error-message {
    margin-top: 16px;
    padding: 12px 16px;
    background: rgba(255, 59, 48, 0.08);
    border: 1px solid rgba(255, 59, 48, 0.3);
    border-radius: var(--radius-sm);
    color: var(--error-color);
    font-size: 14px;
    line-height: 1.5;
}

/* Footer */
footer {
    text-align: center;
    margin-top: 32px;
    color: var(--text-muted);
    font-size: 14px;
}

footer a {
    color: var(--accent-color);
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

.footer-note {
    margin-top: 8px;
    font-size: 12px;
}

/* Responsive adjustments */
@media (max-width: 560px) {
    .container {
        padding: 24px 16px;
    }

    .card {
        padding: 24px;
        border-radius: var(--radius-md);
    }

    h1 {
        font-size: 24px;
    }

    .product-grid {
        grid-template-columns: 1fr;
    }

    .product-card {
        padding: 14px;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .product-card {
        border-width: 3px;
    }

    input,
    select {
        border-width: 2px;
    }
}
