/* ============================================
   Form Styles
   ============================================ */

.register-section, .login-section {
    padding: 140px 0 60px;
    background: var(--bg-dark);
    min-height: 100vh;
}

.register-container {
    max-width: 1100px;
    margin: 0 auto;
}

.register-header {
    text-align: center;
    margin-bottom: 40px;
}

.register-header h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

.register-header p {
    font-size: 1.125rem;
    color: var(--text-muted);
}

.register-form-wrapper {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
}

.register-form {
    background: var(--bg-card);
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
}

.form-section {
    margin-bottom: 30px;
    padding-bottom: 30px;
    border-bottom: 1px solid var(--border-color);
}

.form-section:last-of-type {
    border-bottom: none;
}

.form-section-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--primary);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
}

.form-group {
    margin-bottom: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-main);
    font-size: 0.95rem;
}

.required {
    color: #ef4444;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color, #cbd5e1);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s;
    font-family: inherit;
    background-color: rgba(255, 255, 255, 0.05);
    /* Fallback must be a DARK color so text stays visible on light/white
       backgrounds. Dark-theme pages (register/login) explicitly define
       --text-primary, so they remain unaffected. */
    color: var(--text-primary, #1e293b);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--brand-primary, #3b82f6);
    background-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.form-group small {
    display: block;
    margin-top: 4px;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.checkbox-group {
    margin-bottom: 20px;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    margin-top: 4px;
}

.checkbox-label span {
    flex: 1;
}

.checkbox-label a {
    color: var(--primary-color);
    text-decoration: none;
}

.checkbox-label a:hover {
    text-decoration: underline;
}

.btn-block {
    width: 100%;
    padding: 14px;
    font-size: 1.125rem;
}

.btn-loader {
    display: inline-block;
}

.spinner {
    animation: rotate 2s linear infinite;
    width: 20px;
    height: 20px;
}

.spinner .path {
    stroke: currentColor;
    stroke-linecap: round;
    animation: dash 1.5s ease-in-out infinite;
}

@keyframes rotate {
    100% {
        transform: rotate(360deg);
    }
}

@keyframes dash {
    0% {
        stroke-dasharray: 1, 150;
        stroke-dashoffset: 0;
    }

    50% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -35;
    }

    100% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -124;
    }
}

.form-footer {
    text-align: center;
    margin-top: 20px;
    color: var(--text-light);
}

.form-footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

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

.message {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-weight: 500;
}

.message.success {
    background: rgba(16, 185, 129, 0.1);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.message.error {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Registration Benefits */
.registration-benefits {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 30px;
    border-radius: 16px;
    backdrop-filter: blur(10px);
    height: fit-content;
    position: sticky;
    top: 100px;
}

.registration-benefits h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--text-main);
}

.benefits-list {
    list-style: none;
}

.benefits-list li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
    color: var(--text-main);
}

.check-icon {
    width: 24px;
    height: 24px;
    color: var(--primary);
    flex-shrink: 0;
}

/* Login Page */
.login-section {
    padding: 140px 0 60px;
    background: var(--bg-dark);
    min-height: 100vh;
}

.login-container {
    max-width: 450px;
    margin: 0 auto;
}

.login-form {
    background: var(--bg-card);
    padding: 40px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h1 {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

.login-header p {
    color: var(--text-muted);
}

/* Responsive */
@media (max-width: 768px) {
    .register-section {
        padding: 30px 0;
    }

    .register-header h1 {
        font-size: 1.75rem;
    }

    .register-form-wrapper {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .register-form {
        padding: 20px;
    }

    .registration-benefits {
        position: static;
        padding: 20px;
    }

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

    .login-section {
        padding: 40px 0;
    }

    .login-form {
        padding: 24px;
    }

    /* Better touch targets for buttons and inputs */
    .btn {
        min-height: 48px;
    }
}

/* ============================================
   Policy Modal Styles
   ============================================ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    animation: fadeIn 0.3s ease-out;
}

.modal-card {
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    width: 100%;
    max-width: 800px;
    max-height: 90vh;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-card);
}

.modal-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 0;
}

.close-modal {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-modal:hover {
    background: rgba(255,255,255,0.1);
    color: var(--text-main);
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    position: relative;
    background: var(--bg-dark);
}

.modal-body iframe {
    width: 100%;
    height: 60vh;
    border: none;
    display: block;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    background: var(--bg-card);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

/* Handle mobile iframe scrolling */
@media (max-width: 768px) {
    .modal-card {
        max-height: 95vh;
        border-radius: 16px;
    }
    
    .modal-body iframe {
        height: 70vh;
    }
}