﻿:root {
    --accent-green: #10b981;
}
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Arial, sans-serif;
    background: var(--accent-green);
    color: #333;
    min-height: 100vh;
    overflow-x: hidden;
    zoom: 0.8;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(227, 31, 38, 0.1);
    padding: 18px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 20px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
}

    .header .container {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

.logo {
    transition: transform .3s;
}

    .logo:hover {
        transform: scale(1.05) translateY(-1px);
    }

.navbar-logo {
    height: 65px;
}

.back-link {
    color: #666;
    text-decoration: none;
    font-size: 15px;
    font-weight: 600;
    padding: 10px 18px;
    border-radius: 25px;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    border: 1px solid transparent;
    display: flex;
    align-items: center;
    gap: 8px;
}

    .back-link:hover {
        background-color: #e31f26;
        color: white;
        transform: translateY(-2px);
        box-shadow: 0 8px 20px rgba(227, 31, 38, 0.3);
    }

/* Main Content */
.main-wrapper {
    padding: 40px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 160px);
    width: 100%;
}

.form-container {
    width: 100%;
    max-width: 480px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(30px);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1), 0 8px 16px rgba(0,0,0,0.06);
    padding: 36px 32px;
    border: 1px solid rgba(255,255,255,0.3);
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    margin: 0 auto;
}

    .form-container::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 4px;
        background: linear-gradient(90deg, #e31f26, #ff6b6b, #e31f26);
        animation: gradientShift 4s ease-in-out infinite;
    }

@keyframes gradientShift {
    0%, 100% {
        transform: translateX(-100%);
    }

    50% {
        transform: translateX(100%);
    }
}

.form-container:hover {
    transform: translateY(-4px);
    box-shadow: 0 25px 50px rgba(0,0,0,0.12), 0 10px 20px rgba(0,0,0,0.08);
}

.form-header {
    text-align: center;
    margin-bottom: 32px;
}

.page-title {
    font-size: 28px;
    font-weight: 700;
    color: #333;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #333, #555);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.3px;
}

.page-subtitle {
    color: #666;
    margin-bottom: 12px;
    font-size: 15px;
    font-weight: 500;
}

.login-prompt {
    background: linear-gradient(135deg, rgba(227, 31, 38, 0.08), rgba(255, 107, 107, 0.08));
    border-radius: 10px;
    padding: 12px 16px;
    border: 1px solid rgba(227, 31, 38, 0.1);
    transition: all 0.3s ease;
    font-size: 14px;
}

    .login-prompt:hover {
        background: linear-gradient(135deg, rgba(227, 31, 38, 0.12), rgba(255, 107, 107, 0.12));
        transform: translateY(-1px);
    }

    .login-prompt a {
        color: #e31f26;
        text-decoration: none;
        font-weight: 700;
        transition: all 0.3s ease;
        padding: 2px 6px;
        border-radius: 6px;
    }

        .login-prompt a:hover {
            background-color: rgba(227, 31, 38, 0.1);
            text-decoration: underline;
            transform: translateY(-1px);
        }

/* Form Layout */
.form-grid {
    display: grid;
    gap: 22px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-group-full {
    grid-column: span 2;
}

.input-group {
    position: relative;
    margin-bottom: 0;
}

.form-control {
    width: 100%;
    height: 50px;
    padding: 18px 14px 6px 14px;
    border: 2px solid #e0e6ed;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 500;
    background: rgba(255,255,255,0.9);
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    outline: none;
    z-index: 1;
    position: relative;
}

    .form-control:focus {
        border-color: #e31f26;
        box-shadow: 0 0 0 3px rgba(227, 31, 38, 0.12), 0 3px 10px rgba(227, 31, 38, 0.08);
        background: rgba(255,255,255,1);
        transform: translateY(-2px);
    }

/* CORRECTED: Floating Label Base Style */
.floating-label {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #888;
    font-size: 15px;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    pointer-events: none;
    background-color: transparent;
    padding: 0 6px;
    border-radius: 4px;
    z-index: 2;
    transform-origin: left center;
}

/* CORRECTED: Active/Focused/Filled States */
.form-control:focus + .floating-label,
.form-control:not(:placeholder-shown) + .floating-label,
.input-group.has-content .floating-label,
.input-group.focused .floating-label {
    transform: translateY(-32px) scale(0.8);
    color: #e31f26;
    font-weight: 700;
    background-color: white;
    z-index: 3;
}

/* CORRECTED: Non-focused but filled state */
.form-control:not(:focus):not(:placeholder-shown) + .floating-label,
.input-group:not(.focused).has-content .floating-label {
    transform: translateY(-32px) scale(0.8);
    color: #666;
    font-weight: 600;
    background-color: white;
    z-index: 3;
}

/* Password Field */
.password-group {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #888;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
    padding: 6px;
    border-radius: 6px;
    z-index: 5;
    background-color: rgba(255, 255, 255, 0.9);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e0e6ed;
}

    .password-toggle:hover {
        background-color: rgba(227, 31, 38, 0.1);
        color: #e31f26;
        transform: translateY(-50%) scale(1.1);
        border-color: #e31f26;
    }

/* Adjust padding for password fields to make room for icon */
.password-group .form-control {
    padding-right: 52px;
}

.password-requirements {
    font-size: 12px;
    color: #666;
    margin-top: 10px;
    padding: 12px 16px;
    background: linear-gradient(135deg, rgba(227, 31, 38, 0.06), rgba(255, 107, 107, 0.06));
    border-radius: 10px;
    border-left: 3px solid #e31f26;
    line-height: 1.5;
    font-weight: 500;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    transition: all 0.3s ease;
}

    .password-requirements:hover {
        background: linear-gradient(135deg, rgba(227, 31, 38, 0.08), rgba(255, 107, 107, 0.08));
        transform: translateY(-1px);
    }

    .password-requirements i {
        color: #e31f26;
        margin-top: 1px;
        flex-shrink: 0;
    }

/* Checkbox Section */
.checkbox-section {
    margin: 24px 0;
    padding: 20px;
    background: rgba(248, 249, 250, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    border: 1px solid rgba(227, 31, 38, 0.08);
    transition: all 0.3s ease;
}

    .checkbox-section:hover {
        background: rgba(248, 249, 250, 0.95);
        transform: translateY(-1px);
    }

.custom-checkbox {
    display: flex;
    align-items: flex-start;
    margin-bottom: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 12px;
    border-radius: 10px;
    position: relative;
}

    .custom-checkbox:hover {
        background: rgba(227, 31, 38, 0.04);
        transform: translateX(4px);
    }

    .custom-checkbox:last-child {
        margin-bottom: 0;
    }

    .custom-checkbox input[type="checkbox"] {
        position: absolute;
        opacity: 0;
        cursor: pointer;
        height: 20px;
        width: 20px;
        z-index: 1;
        margin: 0;
    }

.checkmark {
    height: 20px;
    width: 20px;
    background-color: #fff;
    border: 2px solid #ddd;
    border-radius: 5px;
    position: relative;
    margin-right: 12px;
    margin-top: 1px;
    transition: all 0.3s ease;
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    pointer-events: none;
}

.custom-checkbox:hover .checkmark {
    border-color: #e31f26;
    box-shadow: 0 3px 6px rgba(227, 31, 38, 0.2), 0 0 0 3px rgba(227, 31, 38, 0.05);
    transform: translateY(-1px);
}

.custom-checkbox input[type="checkbox"]:checked + .checkmark {
    background: linear-gradient(135deg, #e31f26, #ff6b6b);
    border-color: #e31f26;
    box-shadow: 0 3px 8px rgba(227, 31, 38, 0.3);
}

    .custom-checkbox input[type="checkbox"]:checked + .checkmark:after {
        content: "";
        position: absolute;
        left: 6px;
        top: 2px;
        width: 5px;
        height: 9px;
        border: solid white;
        border-width: 0 2px 2px 0;
        transform: rotate(45deg);
    }

.checkbox-label {
    font-size: 13px;
    color: #555;
    line-height: 1.5;
    cursor: pointer;
    font-weight: 500;
    flex: 1;
}

    .checkbox-label strong {
        color: #333;
        font-weight: 700;
    }

    .checkbox-label small {
        display: block;
        margin-top: 3px;
        color: #777;
        font-size: 11px;
        line-height: 1.4;
    }

/* Submit Button */
.submit-btn {
    width: 100%;
    height: 48px;
    background: linear-gradient(135deg, #e31f26, #ff6b6b);
    border: none;
    border-radius: 12px;
    color: white;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    margin: 16px 0;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(227, 31, 38, 0.3), 0 4px 10px rgba(227, 31, 38, 0.2);
    letter-spacing: 0.3px;
}

    .submit-btn::before {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
        transition: left 0.6s ease;
    }

    .submit-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 12px 25px rgba(227, 31, 38, 0.4), 0 6px 15px rgba(227, 31, 38, 0.25);
    }

        .submit-btn:hover::before {
            left: 100%;
        }

    .submit-btn:active {
        transform: translateY(-1px);
    }

    .submit-btn:disabled {
        background: linear-gradient(135deg, #ccc, #bbb);
        cursor: not-allowed;
        transform: none;
        box-shadow: none;
    }

/* reCAPTCHA */
.recaptcha-notice {
    font-size: 11px;
    color: #666;
    margin-top: 16px;
    text-align: center;
    padding: 12px;
    background: rgba(248, 249, 250, 0.8);
    border-radius: 10px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.3s ease;
    line-height: 1.4;
}

    .recaptcha-notice:hover {
        background: rgba(248, 249, 250, 0.9);
        transform: translateY(-1px);
    }

    .recaptcha-notice i {
        color: #e31f26;
    }

/* Footer */
.footer {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-top: 1px solid rgba(227, 31, 38, 0.08);
    padding: 24px 0;
    text-align: center;
    font-size: 11px;
    color: #666;
    margin-top: 40px;
}

.footer-content {
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.6;
}

.footer-links {
    margin-bottom: 12px;
}

    .footer-links a {
        color: #666;
        text-decoration: none;
        margin: 0 12px;
        font-weight: 600;
        transition: all 0.3s ease;
        padding: 6px 10px;
        border-radius: 15px;
        display: inline-block;
    }

        .footer-links a:hover {
            color: #e31f26;
            background-color: rgba(227, 31, 38, 0.08);
            transform: translateY(-1px);
        }

/* Form Validation */
.form-control.valid {
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.12);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%2310b981' d='m2.3 6.73.94-.94 1.46-1.46c.44-.44.44-1.16 0-1.6s-1.16-.44-1.6 0l-1.46 1.46-.94.94c-.44.44-.44 1.16 0 1.6s1.16.44 1.6 0z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(52px + 12px) center;
    background-size: 16px;
}

.form-control.invalid {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23ef4444'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath d='m5.5 5.5 1 1 1-1'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(52px + 12px) center;
    background-size: 16px;
}

/* For non-password fields, position validation icons normally */
.input-group:not(.password-group) .form-control.valid {
    background-position: right 12px center;
}

.input-group:not(.password-group) .form-control.invalid {
    background-position: right 12px center;
}

/* Email validation message styling */
.email-validation-message {
    display: none;
    font-size: 12px;
    margin-top: 5px;
    padding: 8px 12px;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
    border-left: 3px solid;
}

    .email-validation-message.error {
        color: #ef4444;
        background: rgba(239, 68, 68, 0.08);
        border-left-color: #ef4444;
    }

    .email-validation-message.success {
        color: #10b981;
        background: rgba(16, 185, 129, 0.08);
        border-left-color: #10b981;
    }

    .email-validation-message.checking {
        color: #3b82f6;
        background: rgba(59, 130, 246, 0.08);
        border-left-color: #3b82f6;
    }

/* Enhanced input states for better validation feedback */
.input-group.has-error .form-control {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12);
}

.input-group.has-success .form-control {
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.12);
}

.input-group.has-error .floating-label {
    color: #ef4444 !important;
}

.input-group.has-success .floating-label {
    color: #10b981 !important;
}

/* Loading spinner for email validation */
.email-checking-spinner {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3b82f6;
    border-radius: 50%;
    animation: spinEmailCheck 1s linear infinite;
    z-index: 4;
}

@keyframes spinEmailCheck {
    0% {
        transform: translateY(-50%) rotate(0deg);
    }

    100% {
        transform: translateY(-50%) rotate(360deg);
    }
}

/* Loading Animation for Submit Button */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Accessibility Improvements */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus indicators for keyboard navigation */
.form-control:focus-visible,
.submit-btn:focus-visible,
.back-link:focus-visible,
.logo:focus-visible {
    outline: 3px solid rgba(227, 31, 38, 0.5);
    outline-offset: 2px;
}

/* Additional styles for better UX */
.input-group.focused .floating-label {
    color: #e31f26;
}

.custom-checkbox.checked {
    background: rgba(227, 31, 38, 0.02);
}

.submit-btn.form-complete {
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.3), 0 4px 10px rgba(16, 185, 129, 0.2);
    background: linear-gradient(135deg, #10b981, #059669);
}

    .submit-btn.form-complete:hover {
        box-shadow: 0 12px 25px rgba(16, 185, 129, 0.4), 0 6px 15px rgba(16, 185, 129, 0.25);
    }

.submit-btn.loading-state {
    transform: none !important;
    pointer-events: none;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .main-wrapper {
        padding: 30px 15px;
    }

    .form-container {
        max-width: 460px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 16px;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .form-group-full {
        grid-column: span 1;
    }

    .form-container {
        max-width: 100%;
        margin: 0 16px;
        padding: 28px 24px;
    }

    .main-wrapper {
        padding: 20px 10px;
    }

    .page-title {
        font-size: 24px;
    }

    .logo {
        font-size: 24px;
    }
}

@media (max-width: 480px) {
    .form-container {
        margin: 0 12px;
        padding: 24px 20px;
    }

    .form-control {
        height: 46px;
        padding: 16px 12px 4px 12px;
    }

    .password-group .form-control {
        padding-right: 48px;
    }

    .password-toggle {
        right: 12px;
        width: 28px;
        height: 28px;
        font-size: 14px;
    }

    .checkbox-section {
        padding: 16px;
    }

    .custom-checkbox {
        padding: 10px;
    }
}
