:root {
    /* Ice Blue Brand Colors */
    --primary-color: #0288d1; /* From accent-bright */
    --primary-hover: #0277bd; /* From accent-gold */
    --bg-color: #ecf4f9;      /* From primary-dark */
    --card-bg: #ffffff;
    --text-main: #01579b;     /* From text-light */
    --text-muted: #546e7a;
    --border-color: #b3d9ed;  /* From accent-blue */
    --input-bg: #f5f9fc;
    --font-sans: 'Source Sans Pro', system-ui, -apple-system, sans-serif;
    --font-display: 'Source Sans Pro', sans-serif;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 25px -5px rgba(1, 87, 155, 0.15);
}

.dark-mode {
    --bg-color: #0f172a;
    --card-bg: #1e293b;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border-color: #334155;
    --input-bg: #1e293b;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.5);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.7);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.8);
    --penstripe-opacity: 0.4;
}

body {
    transition: background-color 0.3s ease, color 0.3s ease;
}

.full-width-layout {
    display: block !important;
    padding: 0 !important;
    overflow-x: hidden;
}

.full-width-layout .login-container {
    max-width: none !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
}

.full-width-layout .login-card {
    max-width: none !important;
    width: 100% !important;
    min-height: 100vh;
    border-radius: 0 !important;
    box-shadow: none !important;
    padding: 2rem !important;
}

.penstripe-divider {
    height: 1px;
    background: var(--primary-color);
    opacity: var(--penstripe-opacity, 0.1);
    width: 100%;
    margin: 2rem 0;
}

/* Electrifying nav shimmer animation (shared) */
@keyframes electrify-nav {
    to { background-position: 200% center; }
}

/* Centralized Navigation Styles */
.nav-links {
    display: flex;
    gap: 2.5rem;
    margin-left: auto;
    align-items: center;
}

.nav-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.2s;
    font-family: var(--font-display);
}

.nav-link:hover {
    color: var(--primary-color);
}

/* Greyed out current page state */
.nav-link.current-page {
    color: var(--text-muted);
    opacity: 0.6;
    cursor: default;
}

.nav-link.current-page:hover {
    opacity: 1;
    color: var(--primary-color);
}

/* Navigation Dropdown */
.nav-dropdown {
    position: relative;
    display: inline-block;
    padding: 0.5rem 0;
    /* Creates an invisible bridge to prevent closing when moving to dropdown */
}

.nav-dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background-color: var(--card-bg);
    min-width: 220px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    z-index: 1001;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.5rem 0;
    margin-top: 0;
    overflow: hidden;
    animation: fadeInDropdown 0.2s ease;
}

@keyframes fadeInDropdown {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.nav-dropdown:hover .nav-dropdown-content {
    display: block;
}

.nav-dropdown-item {
    color: var(--text-muted) !important;
    padding: 0.85rem 1.5rem;
    text-decoration: none;
    display: block;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    font-family: var(--font-sans);
    font-weight: 500;
}

.nav-dropdown-item:hover {
    background-color: var(--primary-color) !important;
    color: white !important;
}

.nav-dropdown-item.bold {
    font-weight: 800;
    color: var(--text-main) !important;
}

.nav-dropdown-item.bold:hover {
    color: white !important;
}

/* Layout alignment fixes */
.profile-view {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    max-width: none !important;
}

.profile-card {
    width: 100% !important;
    max-width: none !important;
    padding: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
}

.profile-view header.card-header {
    background: transparent;
    padding: 1rem 2rem !important;
    display: flex !important;
    justify-content: flex-end !important;
    width: 100% !important;
    align-items: center !important;
    border-bottom: none;
    margin: 0 !important;
    position: relative;
    z-index: 1000;
}

.profile-hero {
    padding: 1rem 2rem 2rem 2rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    width: 100%;
}

.nav-links {
    display: flex !important;
    gap: 3rem !important;
    margin: 0 0 0 auto !important;
    /* Force to far right */
    align-items: center !important;
    justify-content: flex-end !important;
}

.profile-section {
    margin-bottom: 3rem;
    width: 100%;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.section-header h2 {
    margin: 0;
    font-family: var(--font-display);
    font-size: 1.25rem;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.section-edit-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0.4rem;
    border-radius: 6px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    font-family: var(--font-sans);
}

.section-edit-btn:hover {
    color: var(--primary-color);
    background: var(--input-bg);
}

.section-edit-btn.editing {
    color: var(--primary-color);
    background: rgba(24, 119, 242, 0.08);
}

.profile-section .section-grid input:read-only,
.profile-section .section-grid select:disabled {
    opacity: 0.7;
    cursor: default;
}

.profile-section .section-grid input:not(:read-only),
.profile-section .section-grid select:not(:disabled) {
    border-color: var(--primary-color);
    opacity: 1;
}

/* Service checkboxes */
.service-checkbox-grid {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.service-checkbox-grid .checkbox-container {
    padding-left: 2rem;
    font-size: 0.9rem;
    pointer-events: none;
    opacity: 0.7;
}

.profile-section.editing .service-checkbox-grid .checkbox-container {
    pointer-events: auto;
    opacity: 1;
}

.profile-section-container {
    padding: 0 2rem 3rem 2rem !important;
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 350px;
    /* 2-column layout */
    gap: 4rem;
    align-items: start;
}

@media (max-width: 1024px) {
    .profile-section-container {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

.profile-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: sticky;
    top: 100px;
    /* Adjust based on header height */
}

/* Foldable Section Styles */
.foldable-section {
    border: 1px solid transparent;
    border-radius: 12px;
    transition: all 0.3s ease;
    margin-bottom: 0.5rem;
}

.foldable-header {
    cursor: pointer;
    padding: 1rem;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
    color: var(--text-muted);
}

.foldable-header:hover {
    background: var(--input-bg);
    color: var(--primary-color);
}

.foldable-header h2 {
    margin: 0 !important;
    font-size: 1.1rem !important;
}

.foldable-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
    opacity: 0;
}

.foldable-section.active .foldable-content {
    max-height: 1000px;
    opacity: 1;
    padding: 1rem;
}

.foldable-section.active {
    border: 1px solid var(--border-color);
}

.foldable-header .chevron {
    transition: transform 0.3s ease;
}

.foldable-section.active .foldable-header .chevron {
    transform: rotate(180deg);
}

.section-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 1.5rem;
}

.btn-primary {
    width: 100%;
    padding: 0.875rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
    filter: brightness(0.9);
}

.btn-primary:disabled {
    background: var(--primary-color);
    opacity: 0.5;
    color: rgba(255, 255, 255, 0.7);
    cursor: not-allowed;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    overflow-x: hidden;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    display: flex;
    align-items: flex-start !important; /* Force top-start alignment */
    justify-content: center;
    min-height: 100vh;
}

/* Auth pages — brand overlay on left 1/4 of background */
.auth-brand-overlay {
    position: fixed;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 25%;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 0;
}

.auth-brand-text {
    font-family: 'Source Sans Pro', sans-serif;
    font-size: 7rem;
    font-weight: 700;
    letter-spacing: -2px;
    background: linear-gradient(135deg, #ffd700 0%, #c9a668 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
    white-space: nowrap;
}

.auth-brand-av {
    font-family: 'Source Sans Pro', sans-serif;
    font-weight: 200;
    background: linear-gradient(135deg, #ffd700 0%, #c9a668 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: inline-block;
}

.auth-brand-prefix {
    background-image: linear-gradient(90deg, #00f2fe 0%, #4facfe 50%, #00f2fe 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: auth-brand-shine 3s linear infinite;
    display: inline-block;
}

@keyframes auth-brand-shine {
    to { background-position: 200% center; }
}

/* ── Privacy/Terms acceptance checkbox ── */
.accept-row {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    margin: 1rem 0 0.5rem;
}
.accept-row input[type="checkbox"] {
    margin-top: 0.15rem;
    flex-shrink: 0;
    width: 15px;
    height: 15px;
    cursor: pointer;
    accent-color: #0277bd;
}
.accept-row label {
    font-size: 0.8rem;
    color: #546e7a;
    line-height: 1.5;
    cursor: pointer;
}
.accept-row label a {
    color: #0277bd;
    text-decoration: underline;
}
.accept-row label a:hover {
    color: #01579b;
}

/* ── Name split row (First + Last side by side) ── */
.name-row {
    display: flex;
    gap: 1rem;
}
.name-row .input-group { flex: 1; min-width: 0; }
@media (max-width: 420px) {
    .name-row { flex-direction: column; gap: 0; }
}

/* ── Inline terms notice (replaces checkbox on signup) ── */
.terms-notice {
    font-size: 0.78rem;
    color: #546e7a;
    text-align: center;
    margin: 0.25rem 0 0.75rem;
    line-height: 1.5;
}
.terms-notice a { color: #0277bd; text-decoration: underline; }
.terms-notice a:hover { color: #01579b; }

/* Auth pages (index & signup) — show background image instead of solid colour */
body.auth-page {
    background-color: transparent;
    background-image: url('assets/bg.webp');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

.login-container {
    padding: 5rem 1.5rem !important;
    width: 100%;
    max-width: 520px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.login-card {
    background-color: var(--card-bg);
    border-radius: 1rem;
    padding: 1.5rem 2.5rem 2.5rem;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

/* Auth Tabs Style */
.auth-tabs {
    display: flex;
    width: 100%;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.auth-tab {
    flex: 1;
    text-align: center;
    padding: 1rem;
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 600;
    font-family: var(--font-display);
    transition: all 0.2s ease;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}

.auth-tab:hover {
    color: var(--primary-color);
}

.auth-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.card-header {
    margin-bottom: 2rem;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand-logo {
    width: 100%;
    max-width: 336px;
    /* Width of input (440 - padding) */
    height: auto;
    object-fit: contain;
}

.login-form {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.input-group label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-main);
}

.input-group input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    font: inherit;
    font-size: 0.9rem;
    background-color: var(--input-bg);
    transition: all 0.2s ease;
    height: 3rem;
    box-sizing: border-box;
}

.input-group input::placeholder {
    color: #90a4ae;
    font-weight: 400;
}

.input-group select {
    width: 100%;
    padding: 0.75rem 1rem;
    padding-right: 2.5rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    font: inherit;
    font-size: 0.9rem;
    background-color: var(--input-bg);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%230277bd' stroke-width='1.8' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    transition: all 0.2s ease;
    height: 3rem;
    box-sizing: border-box;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    background-color: #fff;
    box-shadow: 0 0 0 4px rgba(53, 56, 205, 0.1);
}

.input-group.success input {
    border-color: #10b981;
    background-color: #f0fdf4;
}

.input-group.success input:focus {
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1);
}

.input-group.error input {
    border-color: #ef4444;
    background-color: #fef2f2;
}

.input-group.error input:focus {
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1);
}

.validation-message {
    font-size: 0.75rem;
    margin-top: 0.25rem;
    display: none;
}

.input-group.error .validation-message {
    display: block;
    color: #b91c1c;
}

.requirements-list {
    list-style: none;
    margin-top: 0.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
}

.requirement {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.25rem;
    transition: color 0.2s ease;
}

.requirement::before {
    content: '○';
    font-size: 1rem;
    line-height: 1;
}

.requirement.met {
    color: #059669;
}

.requirement.met::before {
    content: '●';
}

/* Password and Security Features */
.password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-toggle {
    position: absolute;
    right: 0.75rem;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.password-toggle:hover {
    color: var(--primary-color);
}

.password-toggle.active {
    color: var(--primary-color);
}

.eye-icon {
    width: 20px;
    height: 20px;
}

.password-strength-meter {
    height: 4px;
    width: 100%;
    background-color: var(--border-color);
    margin-top: -0.5rem;
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

.password-strength-meter::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 0;
    transition: width 0.3s ease, background-color 0.3s ease;
}

.password-strength-meter.level-1::before {
    width: 25%;
    background-color: #ef4444;
}

.password-strength-meter.level-2::before {
    width: 50%;
    background-color: #f59e0b;
}

.password-strength-meter.level-3::before {
    width: 75%;
    background-color: #3b82f6;
}

.password-strength-meter.level-4::before {
    width: 100%;
    background-color: #10b981;
}

.form-utils {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: -0.25rem;
}

.checkbox-container {
    display: flex;
    align-items: center;
    position: relative;
    padding-left: 1.75rem;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--text-muted);
    user-select: none;
}

.checkbox-container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    height: 1.25rem;
    width: 1.25rem;
    background-color: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.25rem;
    transition: all 0.2s ease;
}

.checkbox-container:hover input~.checkmark {
    background-color: #fff;
    border-color: var(--primary-color);
}

.checkbox-container input:checked~.checkmark {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-container input:checked~.checkmark:after {
    display: block;
}


.forgot-password {
    font-size: 0.875rem;
    color: var(--primary-color);
    text-decoration: none;
    text-align: center;
    font-weight: 500;
}

.forgot-password:hover {
    text-decoration: underline;
}

/* Social Logins */
.divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 1.5rem 0;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.divider::before,
.divider::after {
    content: "";
    flex: 1;
    border-bottom: 1px solid var(--border-color);
}

.divider:not(:empty)::before {
    margin-right: 1rem;
}

.divider:not(:empty)::after {
    margin-left: 1rem;
}

.social-error {
    font-size: 0.875rem;
    color: #ef4444;
    font-weight: 500;
    text-align: center;
    min-height: 1.25rem;
    margin: -0.75rem 0 0.5rem;
    line-height: 1.5;
}

.social-logins {
    display: flex;
    flex-direction: column;
    /* Vertical layout */
    gap: 0.75rem;
    width: 100%;
}

.btn-social {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    /* Gap between icon and text */
    padding: 0.625rem 1rem;
    background-color: #fff;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-sm);
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-main);
    width: 100%;
}

.btn-social:hover:not(:disabled) {
    background-color: var(--bg-color);
    border-color: #d1d5db;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-social:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-social svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* Modifier for Icon-only social buttons (requested for signup) */
.social-logins.icons-only {
    flex-direction: row;
    justify-content: center;
    gap: 1rem;
}

.social-logins.icons-only .btn-social {
    width: auto;
    flex: 0 1 60px;
    padding: 0.75rem;
}

.social-logins.icons-only .btn-social span {
    display: none;
}

.btn-social.apple {
    color: var(--text-main);
}

/* Dark mode: fix invisible text on social buttons */
.dark-mode .btn-social {
    background-color: var(--input-bg);
    color: var(--text-main);
}

.dark-mode .btn-social:hover {
    background-color: var(--border-color);
}

/* Post-Signup Feedback Loop */
.success-state {
    display: none;
    text-align: center;
    padding: 2.5rem 1rem;
    animation: fadeIn 0.4s ease-out;
}

.success-state.active {
    display: block;
}

.success-icon-container {
    width: 64px;
    height: 64px;
    background-color: #f0fdf4;
    border-radius: 50%;
    margin: 0 auto 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #10b981;
}

.success-icon {
    width: 32px;
    height: 32px;
}

.success-state h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem;
    color: var(--text-main);
    margin-bottom: 0.75rem;
}

.success-state p {
    color: var(--text-muted);
    font-size: 0.9375rem;
    line-height: 1.5;
    margin-bottom: 2rem;
}

.feedback-container {
    background-color: var(--bg-color);
    padding: 1.5rem;
    border-radius: 1rem;
    border: 1px solid var(--border-color);
}

.feedback-container h3 {
    font-size: 0.9375rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.rating-stars {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    direction: rtl;
    /* Allows hover-previous stars with CSS */
}

.star-input {
    display: none;
}

.star-label {
    cursor: pointer;
    font-size: 2rem;
    color: #d1d5db;
    transition: all 0.2s ease;
}

.star-label:hover,
.star-label:hover~.star-label,
.star-input:checked~.star-label {
    color: #fbbf24;
    transform: scale(1.1);
}

.thank-you-msg {
    display: none;
    color: #059669;
    font-size: 0.875rem;
    font-weight: 500;
    animation: slideUp 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Email Verification State */
.verification-state {
    display: none;
    text-align: center;
    padding: 2.5rem 1rem;
    animation: fadeIn 0.4s ease-out;
}

.verification-state.active {
    display: block;
}

.inbox-icon-container {
    width: 64px;
    height: 64px;
    background-color: #e0e7ff;
    border-radius: 50%;
    margin: 0 auto 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
}

.inbox-icon {
    width: 32px;
    height: 32px;
}

.verification-state h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem;
    color: var(--text-main);
    margin-bottom: 0.75rem;
}

.verification-state p {
    color: var(--text-muted);
    font-size: 0.9375rem;
    line-height: 1.6;
    margin-bottom: 2rem;
}

.email-highlight {
    color: var(--text-main);
    font-weight: 600;
}

.resend-btn {
    background: none;
    border: none;
    color: var(--primary-color);
    font-weight: 600;
    cursor: pointer;
    font-size: 0.875rem;
    padding: 0;
    text-decoration: underline;
}

/* Welcome Page Specifics */
.welcome-card {
    text-align: center;
    padding: 3rem 2rem;
}

.celebration-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
    z-index: -1;
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    background-color: var(--primary-color);
    opacity: 0.6;
    border-radius: 2px;
    animation: fall 3s infinite linear;
}

@keyframes fall {
    0% {
        transform: translateY(-50px) rotate(0deg);
        opacity: 1;
    }

    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

.welcome-header {
    margin-bottom: 2.5rem;
}

.welcome-title {
    font-family: 'Outfit', sans-serif;
    font-size: 2rem;
    background: var(--primary-color);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1rem;
}

.welcome-subtitle {
    color: var(--text-muted);
    font-size: 1.125rem;
}

.feature-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 2.5rem;
    text-align: left;
}

.feature-card {
    background-color: var(--bg-color);
    padding: 1.25rem;
    border-radius: 0.75rem;
    border: 1px solid var(--border-color);
    transition: transform 0.2s ease;
}

.feature-card:hover {
    transform: translateY(-2px);
    border-color: var(--primary-color);
}

.feature-card h4 {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.feature-card p {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.4;
}

/* Choice Selection Grid */
.choice-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 2.5rem;
}

.choice-instruction {
    display: block;
    font-family: 'Outfit', sans-serif;
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    text-align: center;
    background: var(--primary-color);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.blink-animate {
    animation: blinker 1.5s cubic-bezier(.5, 0, 1, 1) infinite alternate;
}

@keyframes blinker {
    from {
        opacity: 1;
    }

    to {
        opacity: 0.3;
    }
}

.choice-button {
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 1rem 0.5rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.choice-button:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    background-color: #f8faff;
}

.choice-button.selected {
    border-color: var(--primary-color);
    background-color: #eef2ff;
    border-width: 2px;
    padding: calc(1rem - 1px) calc(0.5rem - 1px);
    /* Compensate for border width change */
    box-shadow: 0 4px 12px rgba(53, 56, 205, 0.1);
}

.choice-text {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-main);
    line-height: 1.3;
    text-align: center;
}

.choice-symbol {
    width: 24px;
    height: 24px;
    color: var(--text-muted);
    transition: color 0.2s ease;
}

.choice-button.selected .choice-symbol {
    color: var(--primary-color);
}

/* Subscriber Counters */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-bottom: 2.5rem;
    background-color: #f8fafc;
    padding: 1.25rem;
    border-radius: 1rem;
    border: 1px solid var(--border-color);
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-value {
    font-family: 'Outfit', sans-serif;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.6875rem;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    text-align: center;
}

.card-footer {
    margin-top: 2rem;
    text-align: center;
    border-top: 1px solid var(--border-color);
    padding-top: 1.5rem;
    width: 100%;
}

.card-footer p {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.card-footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.card-footer a:hover {
    text-decoration: underline;
}

/* Profile Page Overhaul */
.profile-view {
    max-width: 900px !important;
}

.profile-card {
    width: 100% !important;
    max-width: 850px !important;
    padding: 3.5rem !important;
    align-items: stretch !important;
    /* Allow children to fill width */
}

.profile-card .card-header {
    margin-bottom: 2.5rem !important;
    text-align: left !important;
    display: block !important;
    width: 100% !important;
}

.profile-card .card-title {
    margin-bottom: 0.75rem !important;
    font-size: 2.25rem !important;
    display: block !important;
    width: 100% !important;
}

.profile-card .card-subtitle {
    margin-bottom: 0 !important;
    display: block !important;
    line-height: 1.5 !important;
    width: 100% !important;
    font-size: 1.125rem !important;
    color: var(--text-muted);
}

.setup-progress-container {
    margin-bottom: 3.5rem;
    text-align: left;
    width: 100% !important;
}

.setup-progress-label {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 1rem;
    padding: 0 4px;
    width: 100% !important;
}

.setup-progress-label span {
    display: inline-block !important;
}

.setup-progress-bar {
    height: 6px;
    background-color: #f1f5f9;
    border-radius: 3px;
    overflow: hidden;
}

.setup-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3538CD, #6172F3);
    width: 85%;
    /* User is almost done */
    border-radius: 3px;
    transition: width 1s ease-out;
}

.form-section-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.075em;
    margin: 2.5rem 0 1.25rem 0;
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 0.75rem;
    width: 100%;
}

.input-icon-group {
    position: relative;
}

.input-icon-group svg {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--text-muted);
    pointer-events: none;
    transition: color 0.2s ease;
}

.input-icon-group input,
.input-icon-group select {
    padding-left: 3.5rem !important;
    height: 3.5rem !important;
    width: 100% !important;
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    font-family: var(--font-sans);
    font-size: 1rem;
    background-color: var(--input-bg);
    transition: all 0.2s ease;
    appearance: none;
    /* Modern select look */
}

.input-icon-group select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 3rem !important;
}

.input-icon-group input:focus,
.input-icon-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    background-color: #fff;
    box-shadow: 0 0 0 4px rgba(53, 56, 205, 0.1);
}

.input-icon-group input:focus+svg,
.input-icon-group select:focus+svg {
    color: var(--primary-color);
}

.trust-certificate {
    background: #f0fdf4;
    border: 1px solid #10b981;
    border-radius: 1rem;
    padding: 1.25rem;
    margin-bottom: 2rem;
    display: flex;
    gap: 1rem;
    align-items: center;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.05);
}

.trust-certificate-icon {
    background-color: white;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #10b981;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.1);
    flex-shrink: 0;
}

.trust-certificate-content h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #065f46;
    margin: 0 0 0.375rem 0;
}

.trust-certificate-content p {
    font-size: 1rem;
    color: #064e3b;
    line-height: 1.5;
    margin: 0;
}

.profile-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    text-align: left;
}

.profile-form-grid .form-group.full-width {
    grid-column: span 2;
}

/* Tesla Fleet Checkbox */
.fleet-checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    cursor: pointer;
    padding: 0.5rem 0.25rem;
    transition: all 0.2s ease;
    user-select: none;
}

.fleet-checkbox-label:hover {
    opacity: 0.8;
}

.fleet-checkbox {
    appearance: none;
    width: 20px;
    height: 20px;
    min-width: 20px;
    border: 2px solid var(--border-color);
    border-radius: 5px;
    background-color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.fleet-checkbox:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.fleet-checkbox:checked::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 1px;
    width: 6px;
    height: 11px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.fleet-checkbox-text {
    font-size: 1rem !important;
    font-weight: 500;
    color: var(--text-main);
    line-height: 1.5;
}

/* Security Badge */
.security-badge {
    margin-top: 1.25rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.75rem;
    background-color: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 2rem;
    color: #166534;
    font-size: 0.75rem;
    font-weight: 500;
}

.lock-icon {
    width: 14px;
    height: 14px;
}

/* OTP Password Flow */
.otp-input-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.otp-digit {
    width: 3rem;
    height: 3.5rem;
    font-size: 1.5rem;
    font-family: var(--font-display);
    font-weight: 600;
    text-align: center;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    background-color: var(--input-bg);
    color: var(--text-main);
    transition: all 0.2s ease;
}

.otp-digit:focus {
    outline: none;
    border-color: var(--primary-color);
    background-color: #fff;
    box-shadow: 0 0 0 4px rgba(24, 119, 242, 0.1);
}

.otp-separator {
    color: var(--text-muted);
    font-weight: 600;
}

.loading-spinner {
    display: inline-block;
    width: 1em;
    height: 1em;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
    margin-right: 0.5rem;
    vertical-align: middle;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ==========================================================================
   Responsive Design & Media Queries
   ========================================================================== */

/* Tablet & Smaller Desktop (Max 900px) */
@media (max-width: 900px) {

    .profile-card,
    .profile-view {
        width: 100% !important;
        max-width: 100% !important;
        padding: 2.5rem 2rem !important;
    }
}

/* Tablet Portrait & Large Mobile (Max 768px) */
@media (max-width: 768px) {
    .profile-form-grid {
        grid-template-columns: 1fr !important;
        gap: 1.25rem !important;
    }

    .profile-form-grid .form-group.full-width {
        grid-column: span 1 !important;
    }

    .choice-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }

    .stats-grid {
        flex-direction: column !important;
        gap: 1.5rem !important;
    }

    .trust-certificate {
        flex-direction: column !important;
        text-align: center !important;
        align-items: center !important;
    }
}

/* ── Auth page responsive layout ────────────────────────────────────────── */

/* Large Desktop (1200px+): brand overlay prominent, card right of centre */
@media (min-width: 1200px) {
    body.auth-page {
        justify-content: flex-end;
        padding-right: 8%;
    }

    .auth-brand-overlay {
        width: 30%;
        font-size: 8rem;
    }
}

/* Desktop (769px – 1199px): brand overlay visible, card centred */
@media (min-width: 769px) and (max-width: 1199px) {
    body.auth-page {
        justify-content: flex-end;
        padding-right: 5%;
    }

    .auth-brand-text {
        font-size: 5.5rem;
    }

    .login-container {
        max-width: 480px;
    }
}

/* Tablet (481px – 768px): logo at top full-width, centre card, reduce padding */
@media (max-width: 768px) {
    .auth-brand-overlay {
        display: flex;
        position: fixed;
        top: 0.75rem;
        left: 0;
        width: 100%;
        transform: none;
        justify-content: center;
    }

    .auth-brand-text {
        font-size: clamp(2.5rem, 21vw, 10rem);
        white-space: nowrap;
    }

    body.auth-page {
        justify-content: center;
        padding-right: 0;
    }

    .login-container {
        max-width: 520px;
        padding: 7rem 1.25rem 3rem !important;
    }

    .login-card {
        padding: 1.5rem 2rem 2rem;
    }

    .profile-form-grid {
        grid-template-columns: 1fr !important;
        gap: 1.25rem !important;
    }

    .profile-form-grid .form-group.full-width {
        grid-column: span 1 !important;
    }

    .choice-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }

    .stats-grid {
        flex-direction: column !important;
        gap: 1.5rem !important;
    }

    .trust-certificate {
        flex-direction: column !important;
        text-align: center !important;
        align-items: center !important;
    }
}

/* Mobile Portrait (Max 480px): full-width card, minimal chrome */
@media (max-width: 480px) {
    .auth-brand-overlay {
        display: flex;
        position: fixed;
        top: 0.75rem;
        left: 0;
        width: 100%;
        transform: none;
        justify-content: center;
    }

    .auth-brand-text {
        font-size: clamp(2rem, 21vw, 5rem);
        white-space: nowrap;
    }

    body.auth-page {
        justify-content: center;
        padding-right: 0;
        background-attachment: scroll; /* Fixed bg causes issues on iOS */
    }

    .login-container {
        padding: 6.5rem 1rem 1.5rem !important;
        max-width: 100%;
    }

    .login-card,
    .profile-card,
    .welcome-card {
        padding: 1.25rem 1.25rem 2rem !important;
        box-shadow: none !important;
        border-radius: 0.75rem !important;
    }

    .auth-tabs {
        margin-bottom: 1.5rem;
    }

    .card-title {
        font-size: 1.75rem !important;
    }

    .card-subtitle {
        font-size: 0.9375rem !important;
    }

    .setup-progress-label {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 0.5rem !important;
    }

    body {
        background-color: var(--card-bg);
    }
}