/* Auth pages styling */
.auth-container {
    min-height: 100vh;
    width: 100%;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 40px 20px;
    box-sizing: border-box;
    position: relative;
    z-index: 1;
}

/* Override all parent containers when auth is shown */
body:has(.auth-container) {
    overflow: hidden;
    height: 100vh;
}

body:has(.auth-container) #app {
    height: 100vh;
    overflow: hidden;
}

body:has(.auth-container) .app-container {
    padding-top: 0;
    min-height: 100vh;
    height: 100vh;
    overflow: hidden;
}

body:has(.auth-container) .main-content {
    margin-left: 0;
    padding: 0;
    min-height: 100vh;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
}

/* Fixed gradient background that covers entire viewport */
body:has(.auth-container) .main-content::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #d946ef 100%);
    z-index: 0;
}

/* Hide navbar, sidebar and footer when auth is shown */
body:has(.auth-container) .navbar,
body:has(.auth-container) .sidebar,
body:has(.auth-container) .sidebar-overlay,
body:has(.auth-container) .app-footer {
    display: none !important;
}

/* Animated background elements */
.auth-container::before {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    top: -200px;
    right: -100px;
    animation: float 6s ease-in-out infinite;
}

.auth-container::after {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    bottom: -150px;
    left: -50px;
    animation: float 8s ease-in-out infinite reverse;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0) scale(1);
    }
    50% {
        transform: translateY(-20px) scale(1.05);
    }
}

.auth-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15), 0 0 1px rgba(0, 0, 0, 0.1);
    padding: 36px 32px;
    width: 100%;
    max-width: 440px;
    position: relative;
    z-index: 1;
    animation: slideUp 0.5s ease-out;
}

/* Register form needs more width for 2-column layout */
.auth-card.register-card {
    max-width: 480px;
}

/* Two column layout for name fields */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.form-row .form-group {
    margin-bottom: 0;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-header {
    text-align: center;
    margin-bottom: 24px;
}

.auth-logo {
    font-size: 2.5rem;
    margin-bottom: 12px;
    display: inline-block;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.auth-title {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

.auth-subtitle {
    color: var(--text-secondary);
    font-size: 0.9375rem;
    line-height: 1.6;
}

.auth-form .form-group {
    margin-bottom: 16px;
    position: relative;
}

/* Floating label inputs */
.auth-form .input-wrapper {
    position: relative;
}

.auth-form .form-input {
    width: 100%;
    padding: 14px 14px 14px 44px;
    font-size: 0.9375rem;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    background-color: #ffffff;
    color: var(--text-primary);
    transition: all 0.3s ease;
    outline: none;
}

.auth-form .form-input::placeholder {
    color: transparent;
}

.auth-form .form-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
    transform: translateY(-2px);
}

.auth-form .form-label {
    position: absolute;
    left: 48px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 0.9375rem;
    font-weight: 500;
    pointer-events: none;
    transition: all 0.3s ease;
    background: transparent;
    padding: 0 4px;
}

.auth-form .form-input:focus + .form-label,
.auth-form .form-input:not(:placeholder-shown) + .form-label {
    top: 0;
    left: 44px;
    font-size: 0.75rem;
    color: var(--primary-color);
    background: #ffffff;
    font-weight: 600;
}

/* Input icons */
.auth-form .input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.25rem;
    color: var(--text-secondary);
    transition: color 0.3s ease;
    z-index: 1;
}

.auth-form .form-input:focus ~ .input-icon {
    color: var(--primary-color);
}

.auth-form .btn {
    width: 100%;
    padding: 16px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary-color) 0%, #8b5cf6 100%);
    color: white;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
    margin-top: 8px;
}

.auth-form .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.auth-form .btn:active {
    transform: translateY(0);
}

.auth-divider {
    display: flex;
    align-items: center;
    margin: 24px 0;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background-color: var(--border-color);
}

.auth-divider::before {
    margin-right: 16px;
}

.auth-divider::after {
    margin-left: 16px;
}

.auth-footer {
    text-align: center;
    margin-top: 32px;
    color: var(--text-secondary);
    font-size: 0.9375rem;
}

.auth-footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
    position: relative;
}

.auth-footer a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary-color);
    transition: width 0.3s ease;
}

.auth-footer a:hover::after {
    width: 100%;
}

/* Family options in register */
.family-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 16px;
    margin-top: 6px;
}

.family-option {
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    padding: 14px 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    background: #ffffff;
    position: relative;
    overflow: hidden;
}

.family-option::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05), rgba(139, 92, 246, 0.05));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.family-option:hover {
    border-color: var(--primary-color);
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.15);
}

.family-option:hover::before {
    opacity: 1;
}

.family-option.selected {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(139, 92, 246, 0.08));
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

.family-option-icon {
    font-size: 1.5rem;
    margin-bottom: 4px;
    display: block;
    transition: transform 0.3s ease;
}

.family-option:hover .family-option-icon {
    transform: scale(1.1);
}

.family-option-title {
    font-weight: 600;
    font-size: 0.8125rem;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.family-option-desc {
    font-size: 0.6875rem;
    color: var(--text-secondary);
    margin-top: 2px;
    line-height: 1.3;
}

/* Conditional family fields */
.family-field {
    display: none;
    animation: fadeInDown 0.3s ease-out;
}

.family-field.visible {
    display: block;
}

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

/* Error message */
.auth-error {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(220, 38, 38, 0.08));
    color: var(--danger-color);
    padding: 14px 18px;
    border-radius: 12px;
    margin-bottom: 24px;
    font-size: 0.875rem;
    border-left: 4px solid var(--danger-color);
    animation: shake 0.5s ease-in-out;
    line-height: 1.5;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

/* Success message */
.auth-success {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(5, 150, 105, 0.08));
    color: var(--success-color);
    padding: 14px 18px;
    border-radius: 12px;
    margin-bottom: 24px;
    font-size: 0.875rem;
    border-left: 4px solid var(--success-color);
    animation: fadeInDown 0.3s ease-out;
    line-height: 1.5;
}

/* Auth links (forgot password, etc.) */
.auth-links {
    text-align: center;
    margin-top: 20px;
    margin-bottom: -4px;
}

.auth-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.8125rem;
    font-weight: 500;
    transition: all 0.2s ease;
    padding: 8px 16px;
    border-radius: 8px;
    display: inline-block;
}

.auth-links a:hover {
    color: var(--primary-color);
    background-color: rgba(99, 102, 241, 0.08);
}

/* Responsive design for mobile */
@media (max-width: 640px) {
    .auth-container {
        padding: 20px 16px;
        align-items: flex-start;
    }

    .auth-card {
        padding: 28px 20px;
        border-radius: 16px;
    }

    .auth-card.register-card {
        max-width: 100%;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .auth-logo {
        font-size: 2.5rem;
    }

    .auth-title {
        font-size: 1.5rem;
    }

    .auth-subtitle {
        font-size: 0.875rem;
    }

    .auth-form .form-input {
        padding: 14px 14px 14px 44px;
        font-size: 16px;
    }

    .auth-form .input-icon {
        left: 14px;
        font-size: 1.125rem;
    }

    .auth-form .form-label {
        left: 44px;
        font-size: 0.875rem;
    }

    .auth-form .form-input:focus + .form-label,
    .auth-form .form-input:not(:placeholder-shown) + .form-label {
        left: 40px;
        font-size: 0.6875rem;
    }

    .auth-form .btn {
        padding: 14px;
        font-size: 0.9375rem;
    }

    .family-options {
        gap: 10px;
    }

    .family-option {
        padding: 16px 12px;
    }

    .family-option-icon {
        font-size: 1.75rem;
    }

    .family-option-title {
        font-size: 0.875rem;
    }

    .family-option-desc {
        font-size: 0.75rem;
    }

    .auth-footer {
        font-size: 0.875rem;
        margin-top: 24px;
    }
}

@media (max-width: 380px) {
    .auth-card {
        padding: 28px 20px;
    }

    .auth-title {
        font-size: 1.375rem;
    }

    .family-options {
        grid-template-columns: 1fr;
        gap: 8px;
    }
}

/* Landing Page Styles */
.landing-container {
    min-height: 100vh;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    box-sizing: border-box;
    position: relative;
    z-index: 1;
}

/* Apply same overrides for landing */
body:has(.landing-container) {
    overflow: hidden;
    height: 100vh;
}

body:has(.landing-container) #app {
    height: 100vh;
    overflow: hidden;
}

body:has(.landing-container) .app-container {
    padding-top: 0;
    min-height: 100vh;
    height: 100vh;
    overflow: hidden;
}

body:has(.landing-container) .main-content {
    margin-left: 0;
    padding: 0;
    min-height: 100vh;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
}

body:has(.landing-container) .main-content::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #d946ef 100%);
    z-index: 0;
}

body:has(.landing-container) .navbar,
body:has(.landing-container) .sidebar,
body:has(.landing-container) .sidebar-overlay,
body:has(.landing-container) .app-footer {
    display: none !important;
}

.landing-hero {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    padding: 48px 40px;
    width: 100%;
    max-width: 480px;
    text-align: center;
    position: relative;
    z-index: 1;
    animation: slideUp 0.5s ease-out;
}

.landing-logo {
    font-size: 4rem;
    margin-bottom: 16px;
    display: inline-block;
    animation: pulse 2s ease-in-out infinite;
}

.landing-title {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 12px;
    letter-spacing: -0.03em;
}

.landing-subtitle {
    font-size: 1.125rem;
    color: var(--primary-color);
    font-weight: 600;
    line-height: 1.6;
    margin-bottom: 16px;
}

.landing-story {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 28px;
    padding: 0 8px;
}

.landing-footer {
    font-size: 0.8125rem;
    color: var(--text-tertiary, #9ca3af);
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.landing-features {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 28px;
    text-align: left;
}

.landing-feature {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    border-radius: 12px;
    background: rgba(99, 102, 241, 0.05);
    transition: transform 0.2s ease, background 0.2s ease;
}

.landing-feature:hover {
    background: rgba(99, 102, 241, 0.1);
    transform: translateY(-2px);
}

.landing-feature-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.landing-feature-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.landing-feature-text strong {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

.landing-feature-text span {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.landing-cta {
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: center;
}

.landing-cta .btn-lg {
    padding: 18px 48px;
    font-size: 1.125rem;
    font-weight: 700;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--primary-color) 0%, #8b5cf6 100%);
    color: white;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.35);
}

.landing-cta .btn-lg:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.45);
}

.landing-login-link {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    margin: 0;
}

.landing-login-link a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.landing-login-link a:hover {
    color: #8b5cf6;
}

/* Landing responsive */
@media (max-width: 640px) {
    .landing-container {
        padding: 20px 16px;
        align-items: flex-start;
    }

    .landing-hero {
        padding: 32px 24px;
        border-radius: 20px;
    }

    .landing-logo {
        font-size: 3rem;
    }

    .landing-title {
        font-size: 1.875rem;
    }

    .landing-subtitle {
        font-size: 1rem;
        margin-bottom: 24px;
    }

    .landing-features {
        gap: 10px;
    }

    .landing-feature {
        padding: 14px;
    }

    .landing-cta .btn-lg {
        width: 100%;
        padding: 16px 32px;
        font-size: 1rem;
    }
}

/* Terms and Conditions Checkbox */
.terms-checkbox {
    margin: 16px 0;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    accent-color: var(--primary);
    cursor: pointer;
    flex-shrink: 0;
}

.checkbox-text {
    line-height: 1.4;
}

.checkbox-text a {
    color: var(--primary);
    text-decoration: underline;
    font-weight: 500;
}

.checkbox-text a:hover {
    color: var(--primary-dark);
}

/* Email Verification Loading */
.verify-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 30px;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(99, 102, 241, 0.2);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Email Verification Required Screen */
.verify-required-card {
    text-align: center;
    max-width: 420px;
}

.verify-required-card .verify-icon {
    font-size: 4rem;
    margin-bottom: 16px;
    animation: pulse 2s ease-in-out infinite;
}

.verify-required-card h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.verify-required-card .verify-message {
    color: var(--text-secondary);
    font-size: 0.9375rem;
    line-height: 1.6;
    margin-bottom: 24px;
}

.verify-required-card .verify-message strong {
    color: var(--primary-color);
}

.verify-required-card .verify-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.verify-required-card .btn {
    padding: 14px 24px;
    font-size: 0.9375rem;
    font-weight: 600;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.verify-required-card .btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, #8b5cf6 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.verify-required-card .btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.verify-required-card .btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.verify-required-card .btn-secondary {
    background: #f1f5f9;
    color: var(--text-primary);
}

.verify-required-card .btn-secondary:hover {
    background: #e2e8f0;
}

.verify-required-card .btn-link {
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.verify-required-card .btn-link:hover {
    color: var(--danger-color);
}

.verify-required-card .verify-hint {
    margin-top: 20px;
    font-size: 0.8125rem;
    color: var(--text-tertiary, #9ca3af);
}

@media (max-width: 640px) {
    .verify-required-card {
        padding: 28px 20px;
    }

    .verify-required-card .verify-icon {
        font-size: 3rem;
    }

    .verify-required-card h2 {
        font-size: 1.5rem;
    }
}

/* Google OAuth Button (follows Google Branding Guidelines) */
.btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    height: 48px;
    background: white;
    color: #3c4043;
    border: 1px solid #dadce0;
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(60, 64, 67, 0.1);
}

.btn-google:hover {
    background: #f8f9fa;
    box-shadow: 0 2px 6px rgba(60, 64, 67, 0.2);
    border-color: #d2d3d4;
}

.btn-google:active {
    background: #f1f3f4;
    box-shadow: 0 1px 2px rgba(60, 64, 67, 0.15);
}

.btn-google:focus {
    outline: 2px solid #4285f4;
    outline-offset: 2px;
}

.btn-google svg {
    flex-shrink: 0;
}

.btn-google span {
    line-height: 1;
}

/* Secondary button style (for cancel actions in Google flows) */
.btn-secondary {
    width: 100%;
    padding: 14px;
    font-size: 0.9375rem;
    font-weight: 500;
    border-radius: 10px;
    background: #f1f5f9;
    color: var(--text-primary);
    border: 1px solid #e2e8f0;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: #e2e8f0;
    border-color: #cbd5e1;
}

.btn-secondary:active {
    background: #cbd5e1;
}

/* Responsive adjustments for Google button */
@media (max-width: 640px) {
    .btn-google {
        height: 44px;
        font-size: 0.875rem;
        gap: 10px;
    }

    .btn-google svg {
        width: 18px;
        height: 18px;
    }
}

