:root {
    --ri-dark: #0B0B0B;
    --ri-dark-light: #1A1A1A;
    --ri-dark-card: #141414;
    --ri-gold: #C8A75B;
    --ri-gold-dark: #A8893F;
    --ri-gold-light: #E8D48B;
    --ri-red: #D72638;
    --ri-red-dark: #B01E2E;
    --ri-muted: #777777;
    --ri-success: #27AE60;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--ri-dark);
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden;
}

.auth-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Right Panel - Branding */
.auth-branding {
    flex: 1;
    background: linear-gradient(160deg, #0B0B0B 0%, #1A1A1A 40%, #0B0B0B 100%);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px;
}

.auth-branding::before {
    content: '';
    position: absolute;
    top: -30%;
    left: -30%;
    width: 160%;
    height: 160%;
    background: radial-gradient(ellipse at 30% 50%, rgba(200,167,91,0.06) 0%, transparent 60%);
    animation: brandGlow 10s ease-in-out infinite;
}

.auth-branding::after {
    content: '';
    position: absolute;
    bottom: -20%;
    right: -20%;
    width: 80%;
    height: 80%;
    background: radial-gradient(ellipse at center, rgba(215,38,56,0.04) 0%, transparent 60%);
    animation: brandGlow 8s ease-in-out infinite reverse;
}

@keyframes brandGlow {
    0%, 100% { opacity: 0.5; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.05); }
}

.auth-branding-grid {
    position: absolute;
    inset: 0;
    background-image: linear-gradient(rgba(200,167,91,0.03) 1px, transparent 1px), linear-gradient(90deg, rgba(200,167,91,0.03) 1px, transparent 1px);
    background-size: 60px 60px;
}

.auth-branding-content {
    position: relative;
    z-index: 1;
    text-align: center;
}

.auth-logo-wrapper {
    width: 100px;
    height: 100px;
    margin: 0 auto 32px;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(200,167,91,0.2);
}

.auth-logo-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.auth-brand-name {
    font-size: 2.5rem;
    font-weight: 800;
    color: white;
    margin-bottom: 8px;
}

.auth-brand-name .red { color: var(--ri-red); }
.auth-brand-name .gold { background: linear-gradient(135deg, var(--ri-gold), var(--ri-gold-light)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }

.auth-brand-tagline {
    font-size: 16px;
    color: rgba(255,255,255,0.5);
    font-weight: 400;
    margin-bottom: 48px;
}

.auth-features {
    max-width: 360px;
    margin: 0 auto;
    text-align: left;
}

.auth-feature {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 14px;
    margin-bottom: 12px;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.auth-feature:hover {
    background: rgba(200,167,91,0.05);
    border-color: rgba(200,167,91,0.2);
    transform: translateX(4px);
}

.auth-feature-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(200,167,91,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.auth-feature-icon svg {
    color: var(--ri-gold);
}

.auth-feature-text {
    font-size: 14px;
    color: rgba(255,255,255,0.7);
    font-weight: 500;
}

/* Left Panel - Form */
.auth-form-panel {
    flex: 0 0 520px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 60px;
    background: #FFFFFF;
    border-right: 1px solid rgba(0,0,0,0.06);
}

.auth-form-inner {
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
}

.auth-form-header {
    margin-bottom: 32px;
}

.auth-form-header h1 {
    font-size: 28px;
    font-weight: 800;
    color: #1A1A1A;
    margin-bottom: 8px;
}

.auth-form-header p {
    font-size: 15px;
    color: #777777;
    margin: 0;
}

.auth-input-group {
    margin-bottom: 18px;
}

.auth-input-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #444444;
    margin-bottom: 8px;
}

.auth-input-wrapper {
    position: relative;
}

.auth-input-wrapper .input-icon {
    position: absolute;
    top: 50%;
    left: 16px;
    transform: translateY(-50%);
    color: var(--ri-gold);
}

.auth-input {
    width: 100%;
    height: 52px;
    padding: 0 16px 0 48px;
    background: #F9F9F9;
    border: 1px solid #E8E8E8;
    border-radius: 12px;
    color: #1A1A1A;
    font-size: 15px;
    font-family: 'Inter', sans-serif;
    transition: all 0.2s ease;
    outline: none;
}

.auth-input::placeholder { color: #AAAAAA; }

.auth-input:focus {
    border-color: var(--ri-gold);
    background: #FFFFFF;
    box-shadow: 0 0 0 3px rgba(200,167,91,0.12);
}

.auth-input-hint {
    font-size: 12px;
    color: #999999;
    margin-top: 6px;
}

.auth-toggle-pw {
    position: absolute;
    top: 50%;
    right: 16px;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #AAAAAA;
    cursor: pointer;
    padding: 4px;
    transition: color 0.2s;
}

.auth-toggle-pw:hover { color: var(--ri-gold); }

.auth-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.auth-submit {
    width: 100%;
    height: 52px;
    background: linear-gradient(135deg, var(--ri-gold), var(--ri-gold-dark));
    color: #0B0B0B;
    font-size: 15px;
    font-weight: 700;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Inter', sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 28px;
}

.auth-submit:hover {
    background: linear-gradient(135deg, var(--ri-gold-light), var(--ri-gold));
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(200,167,91,0.3);
}

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

.auth-submit .spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(0,0,0,0.2);
    border-top-color: #0B0B0B;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

.auth-footer {
    text-align: center;
    margin-top: 28px;
}

.auth-footer span {
    font-size: 14px;
    color: #999999;
}

.auth-footer a {
    font-size: 14px;
    color: var(--ri-gold-dark);
    font-weight: 600;
    text-decoration: none;
    margin-left: 4px;
    transition: color 0.2s;
}

.auth-footer a:hover { color: var(--ri-gold); }

.auth-copyright {
    margin-top: 32px;
    text-align: center;
    font-size: 12px;
    color: #BBBBBB;
}

.auth-alert {
    padding: 14px 16px;
    border-radius: 12px;
    margin-bottom: 24px;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.auth-alert-error {
    background: #FEF2F2;
    border: 1px solid #FECACA;
    color: #B91C1C;
}

.auth-alert-error ul {
    margin: 0;
    padding-left: 16px;
    list-style: disc;
}

.auth-alert-error li {
    margin-bottom: 2px;
}

.auth-form-inner::before {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, var(--ri-gold), var(--ri-gold-light));
    border-radius: 2px;
    margin-bottom: 32px;
}

.password-mismatch {
    font-size: 12px;
    color: #DC2626;
    margin-top: 6px;
    display: none;
}

/* Terms Checkbox */
.auth-terms-group {
    margin-top: 20px;
}

.auth-terms-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    position: relative;
    padding-left: 30px;
}

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

.auth-terms-checkmark {
    position: absolute;
    left: 0;
    top: 2px;
    width: 20px;
    height: 20px;
    background: #F9F9F9;
    border: 2px solid #E0E0E0;
    border-radius: 5px;
    transition: all 0.2s ease;
}

.auth-terms-label input:checked ~ .auth-terms-checkmark {
    background: var(--ri-gold);
    border-color: var(--ri-gold);
}

.auth-terms-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);
}

.auth-terms-label input:checked ~ .auth-terms-checkmark::after {
    display: block;
}

.auth-terms-text {
    font-size: 13px;
    color: #555555;
    line-height: 1.5;
}

.auth-terms-text a {
    color: var(--ri-gold-dark);
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s;
}

.auth-terms-text a:hover {
    color: var(--ri-gold);
    text-decoration: underline;
}

/* Terms Modal */
.terms-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(4px);
}

.terms-modal-overlay.active {
    display: flex;
}

.terms-modal {
    background: #FFFFFF;
    border-radius: 16px;
    width: 100%;
    max-width: 720px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
}

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

.terms-modal-header {
    padding: 28px 32px 20px;
    border-bottom: 1px solid #F0F0F0;
    position: relative;
}

.terms-modal-header h2 {
    font-size: 20px;
    font-weight: 800;
    color: #1A1A1A;
    margin: 0 0 4px;
}

.terms-modal-header p {
    font-size: 13px;
    color: #777777;
    margin: 0;
}

.terms-modal-close {
    position: absolute;
    top: 20px;
    right: 24px;
    width: 32px;
    height: 32px;
    border: none;
    background: #F5F5F5;
    border-radius: 8px;
    font-size: 20px;
    color: #777;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.terms-modal-close:hover {
    background: #EEE;
    color: #333;
}

.terms-modal-body {
    padding: 24px 32px;
    overflow-y: auto;
    flex: 1;
}

.terms-modal-body .terms-content h3 {
    font-size: 15px;
    font-weight: 700;
    color: #1A1A1A;
    margin: 24px 0 10px;
    padding-top: 16px;
    border-top: 1px solid #F5F5F5;
}

.terms-modal-body .terms-content h3:first-of-type {
    border-top: none;
    padding-top: 0;
}

.terms-modal-body .terms-content h4 {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin: 14px 0 6px;
}

.terms-modal-body .terms-content p {
    font-size: 13px;
    color: #555;
    line-height: 1.7;
    margin: 0 0 10px;
}

.terms-modal-body .terms-content ul {
    padding-left: 20px;
    margin: 8px 0 12px;
}

.terms-modal-body .terms-content li {
    font-size: 13px;
    color: #555;
    line-height: 1.7;
    margin-bottom: 4px;
}

.terms-modal-body .terms-important {
    background: #FFF8E1;
    border: 1px solid #FFE082;
    border-radius: 8px;
    padding: 12px 16px;
    color: #6D4C00;
    font-size: 14px;
}

.terms-modal-body .terms-warning {
    color: var(--ri-red);
}

.terms-modal-body .terms-final {
    margin-top: 24px;
    padding: 20px;
    background: #FFF5F5;
    border: 1px solid #FECACA;
    border-radius: 10px;
    text-align: center;
}

.terms-modal-footer {
    padding: 20px 32px;
    border-top: 1px solid #F0F0F0;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.terms-btn-disagree {
    padding: 12px 24px;
    border: 1px solid #E0E0E0;
    background: #FFFFFF;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    color: #777;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Inter', sans-serif;
}

.terms-btn-disagree:hover {
    background: #F5F5F5;
    color: #333;
}

.terms-btn-agree {
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--ri-gold), var(--ri-gold-dark));
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    color: #0B0B0B;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Inter', sans-serif;
}

.terms-btn-agree:hover {
    background: linear-gradient(135deg, var(--ri-gold-light), var(--ri-gold));
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(200,167,91,0.3);
}

/* Responsive */
@media (max-width: 1024px) {
    .auth-branding { display: none; }
    .auth-form-panel {
        flex: 1;
        padding: 40px 24px;
    }
}

@media (max-width: 480px) {
    .auth-form-panel { padding: 32px 20px; }
    .auth-form-header h1 { font-size: 24px; }
    .auth-row { grid-template-columns: 1fr; }
}
