/* ============================================
   EngageAI Client Onboarding Form
   Brand Colors: #1E3A5F (brandBlue), #E8F0F7 (lightBlue)
   ============================================ */

:root {
    --brand-blue: #1E3A5F;
    --brand-blue-dark: #152a45;
    --brand-blue-light: #2a4a73;
    --light-blue: #E8F0F7;
    --light-blue-hover: #d8e8f5;
    --white: #ffffff;
    --off-white: #f8fafc;
    --grey-50: #f9fafb;
    --grey-100: #f3f4f6;
    --grey-200: #e5e7eb;
    --grey-300: #d1d5db;
    --grey-400: #9ca3af;
    --grey-500: #6b7280;
    --grey-600: #4b5563;
    --grey-700: #374151;
    --grey-800: #1f2937;
    --grey-900: #111827;
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;
    
    --font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --border-radius: 12px;
    --border-radius-sm: 8px;
    --border-radius-lg: 16px;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --transition: all 0.2s ease;
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    font-size: 16px;
    line-height: 1.6;
    color: var(--grey-800);
    background: var(--off-white);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Page Wrapper */
.page-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    background: var(--white);
    border-bottom: 1px solid var(--grey-200);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 900px;
    margin: 0 auto;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: var(--brand-blue);
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-weight: 700;
    font-size: 1.25rem;
}

.logo-icon.small {
    width: 32px;
    height: 32px;
    font-size: 1rem;
}

.logo-text {
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--brand-blue);
}

.header-tag {
    font-size: 0.875rem;
    color: var(--grey-500);
    font-weight: 500;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--brand-blue) 0%, var(--brand-blue-dark) 100%);
    color: var(--white);
    padding: 3rem 1.5rem;
    position: relative;
    overflow: hidden;
}

.hero-content {
    max-width: 900px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.hero h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    letter-spacing: -0.025em;
}

.hero p {
    font-size: 1.125rem;
    opacity: 0.9;
    max-width: 600px;
    margin-bottom: 1.5rem;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    padding: 0.5rem 1rem;
    border-radius: 100px;
    font-size: 0.875rem;
    font-weight: 500;
}

.badge-dot {
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.hero-decoration {
    position: absolute;
    top: -50%;
    right: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    border-radius: 50%;
}

/* Main Content */
.main-content {
    flex: 1;
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    width: 100%;
}

/* Form Sections */
.form-section {
    background: var(--white);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
    overflow: hidden;
    border: 1px solid var(--grey-200);
}

.section-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    background: var(--grey-50);
    border-bottom: 1px solid var(--grey-200);
}

.section-number {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--brand-blue);
    background: var(--light-blue);
    padding: 0.25rem 0.625rem;
    border-radius: 100px;
    letter-spacing: 0.05em;
}

.section-header h2 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--grey-800);
}

.section-note {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    background: var(--light-blue);
    border-bottom: 1px solid var(--grey-200);
}

.note-icon {
    flex-shrink: 0;
    color: var(--brand-blue);
    margin-top: 0.125rem;
}

.section-note p {
    font-size: 0.9375rem;
    color: var(--grey-700);
}

.section-note strong {
    color: var(--brand-blue);
    font-weight: 600;
}

.section-content {
    padding: 1.5rem;
}

.subsection-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--grey-600);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--grey-200);
}

.subsection-title:not(:first-child) {
    margin-top: 2rem;
}

/* Form Grid */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
}

@media (max-width: 640px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
}

/* Form Groups */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--grey-700);
}

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

/* Inputs */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="url"],
input[type="number"],
input[type="password"],
input[type="date"],
select,
textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    font-family: inherit;
    color: var(--grey-800);
    background: var(--white);
    border: 1px solid var(--grey-300);
    border-radius: var(--border-radius-sm);
    transition: var(--transition);
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--brand-blue);
    box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.1);
}

input::placeholder,
textarea::placeholder {
    color: var(--grey-400);
}

select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%236b7280' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
    cursor: pointer;
}

textarea {
    resize: vertical;
    min-height: 100px;
}

/* Input with prefix/suffix */
.input-with-prefix,
.input-with-suffix {
    position: relative;
    display: flex;
    align-items: stretch;
}

.input-prefix,
.input-suffix {
    display: flex;
    align-items: center;
    padding: 0 0.875rem;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--grey-500);
    background: var(--grey-100);
    border: 1px solid var(--grey-300);
}

.input-prefix {
    border-right: none;
    border-radius: var(--border-radius-sm) 0 0 var(--border-radius-sm);
}

.input-suffix {
    border-left: none;
    border-radius: 0 var(--border-radius-sm) var(--border-radius-sm) 0;
}

.input-with-prefix input {
    border-radius: 0 var(--border-radius-sm) var(--border-radius-sm) 0;
}

.input-with-suffix input {
    border-radius: var(--border-radius-sm) 0 0 var(--border-radius-sm);
}

/* Field Hint */
.field-hint {
    font-size: 0.8125rem;
    color: var(--grey-500);
    margin-top: 0.25rem;
}

/* Checkboxes */
.checkbox-group {
    padding-top: 0.5rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    user-select: none;
}

.checkbox-label.compact {
    gap: 0.5rem;
}

.checkbox-label input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.checkbox-custom {
    width: 20px;
    height: 20px;
    border: 2px solid var(--grey-300);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    flex-shrink: 0;
}

.checkbox-label input:checked + .checkbox-custom {
    background: var(--brand-blue);
    border-color: var(--brand-blue);
}

.checkbox-label input:checked + .checkbox-custom::after {
    content: '';
    width: 6px;
    height: 10px;
    border: solid var(--white);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    margin-bottom: 2px;
}

.checkbox-label input:focus + .checkbox-custom {
    box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.1);
}

.checkbox-text {
    font-size: 0.9375rem;
    color: var(--grey-700);
}

.checkbox-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 0.5rem;
}

/* Security Notice */
.security-notice {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    background: var(--grey-50);
    border: 1px solid var(--grey-200);
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
}

.security-icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    background: var(--light-blue);
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--brand-blue);
}

.security-text strong {
    display: block;
    font-size: 0.9375rem;
    color: var(--grey-800);
    margin-bottom: 0.25rem;
}

.security-text p {
    font-size: 0.875rem;
    color: var(--grey-600);
    line-height: 1.5;
}

/* Submit Button */
.form-submit {
    text-align: center;
    padding: 1rem 0 2rem;
}

.submit-button {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 2rem;
    font-size: 1.0625rem;
    font-weight: 600;
    font-family: inherit;
    color: var(--white);
    background: var(--brand-blue);
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-md);
}

.submit-button:hover {
    background: var(--brand-blue-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.submit-button:active {
    transform: translateY(0);
}

.submit-button svg {
    transition: transform 0.2s ease;
}

.submit-button:hover svg {
    transform: translateX(4px);
}

/* Footer */
.footer {
    background: var(--grey-900);
    color: var(--grey-400);
    padding: 2rem 1.5rem;
    margin-top: auto;
}

.footer-content {
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
}

.footer-logo {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--white);
    font-weight: 600;
    margin-bottom: 1rem;
}

.footer-links {
    margin-bottom: 1rem;
}

.footer-links a {
    color: var(--grey-400);
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: var(--white);
}

.footer-links .divider {
    margin: 0 0.75rem;
    color: var(--grey-600);
}

.footer-copyright {
    font-size: 0.8125rem;
    color: var(--grey-500);
}

/* Utility */
.hidden {
    display: none !important;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.form-section {
    animation: fadeInUp 0.5s ease forwards;
}

.form-section:nth-child(1) { animation-delay: 0.1s; }
.form-section:nth-child(2) { animation-delay: 0.15s; }
.form-section:nth-child(3) { animation-delay: 0.2s; }
.form-section:nth-child(4) { animation-delay: 0.25s; }
.form-section:nth-child(5) { animation-delay: 0.3s; }
.form-section:nth-child(6) { animation-delay: 0.35s; }
.form-section:nth-child(7) { animation-delay: 0.4s; }
.form-section:nth-child(8) { animation-delay: 0.45s; }

/* Responsive */
@media (max-width: 768px) {
    .header-content {
        padding: 0.875rem 1rem;
    }
    
    .header-tag {
        display: none;
    }
    
    .hero {
        padding: 2rem 1rem;
    }
    
    .hero h1 {
        font-size: 1.5rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
    
    .main-content {
        padding: 1rem;
    }
    
    .section-header {
        padding: 1rem;
    }
    
    .section-content {
        padding: 1rem;
    }
    
    .section-note {
        padding: 0.875rem 1rem;
    }
    
    .security-notice {
        flex-direction: column;
        text-align: center;
    }
    
    .security-icon {
        margin: 0 auto;
    }
}

/* Form Validation Errors */
.field-error {
    border-color: #ef4444 !important;
    background-color: #fef2f2 !important;
}

.field-error:focus {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15) !important;
}

.error-message {
    display: block;
    font-size: 0.8125rem;
    color: #ef4444;
    margin-top: 0.375rem;
    font-weight: 500;
}

/* Validation Summary */
.validation-summary {
    display: flex;
    align-items: flex-start;
    gap: 0.875rem;
    padding: 1rem 1.25rem;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
    position: relative;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.summary-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    background: #fee2e2;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ef4444;
}

.summary-text strong {
    display: block;
    font-size: 0.9375rem;
    color: #991b1b;
    margin-bottom: 0.25rem;
}

.summary-text p {
    font-size: 0.875rem;
    color: #b91c1c;
    margin: 0;
}

.summary-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 28px;
    height: 28px;
    background: transparent;
    border: none;
    font-size: 1.25rem;
    color: #991b1b;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.2s ease;
}

.summary-close:hover {
    background: #fee2e2;
}

/* Input wrapper error state */
.input-with-prefix .field-error,
.input-with-suffix .field-error {
    border-color: #ef4444 !important;
}
