
:root {
    --brand-navy: #0B2246;
    --brand-navy-light: #16335F;
    --brand-gold: #C68A00;
    --brand-gold-soft: #FFF8E7;
    --brand-gold-hover: #B07B00;
    --bg-main: #F4F6F9;
    --surface-card: rgba(255, 255, 255, 0.92);
    --border-color: rgba(203, 213, 225, 0.8);
    --font-xs: 13px;
    --font-sm: 15px;
    --font-base: 16px;
    --font-lg: 18px;
    --font-xl: 22px;
    --text-main: #0F172A;
    --text-muted: #475569;
    --text-white: #FFFFFF;
    --radius-sm: 10px;
    --radius-md: 18px;
    --shadow-soft: 0 20px 40px -15px rgba(11, 34, 70, 0.12);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Plus Jakarta Sans', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 40px 20px;
    position: relative;
    overflow-x: hidden;
}

/* Dynamic Background Canvas */
.bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
    background: radial-gradient(circle at 50% 50%, #F8FAFC 0%, #E2E8F0 100%);
}

.bg-canvas::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(rgba(11, 34, 70, 0.08) 1px, transparent 1px);
    background-size: 28px 28px;
    opacity: 0.7;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(70px);
    opacity: 0.45;
    animation: float 14s infinite ease-in-out alternate;
}

.blob-1 {
    width: 450px;
    height: 450px;
    background: var(--brand-gold);
    top: -120px;
    right: -100px;
}

.blob-2 {
    width: 400px;
    height: 400px;
    background: var(--brand-navy);
    bottom: -100px;
    left: -80px;
    animation-delay: -6s;
}

.blob-3 {
    width: 300px;
    height: 300px;
    background: #818CF8;
    top: 35%;
    left: 10%;
    animation-delay: -10s;
    opacity: 0.25;
}

@keyframes float {
    0% { transform: translate(0px, 0px) scale(1); }
    50% { transform: translate(-30px, 40px) scale(1.08); }
    100% { transform: translate(40px, -30px) scale(0.95); }
}

/* Card Layout Container */
.auth-card {
    background: var(--surface-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-soft);
    width: 100%;
    max-width: 640px;
    padding: 40px 36px;
    position: relative;
    z-index: 10;
}

.auth-header {
    text-align: center;
    margin-bottom: 28px;
}

.logo-container {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    font-size: var(--font-xl);
    text-decoration: none;
    margin-bottom: 12px;
}

.brand-icon {
    width: 44px;
    height: 44px;
    background: var(--brand-navy);
    border: 2px solid var(--brand-gold);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.brand-icon i {
    color: var(--brand-gold);
    fill: var(--brand-gold);
}

.logo-text .text-go { color: var(--brand-navy); }
.logo-text .text-scribe { color: var(--brand-gold); }
.logo-text .text-24 { color: var(--brand-navy); }

.auth-title {
    font-size: var(--font-xl);
    font-weight: 800;
    color: var(--brand-navy);
    margin-bottom: 6px;
}

.auth-subtitle {
    font-size: var(--font-sm);
    color: var(--text-muted);
}

/* Form Layout Grid */
.django-form-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

@media (min-width: 576px) {
    .django-form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    column-gap: 16px;
    row-gap: 18px;
    }

    .form-group.full-width,
    .form-group:has(#id_referrer),
    .form-group:has(#address),
    .form-group:has([name="address"]) {
    grid-column: span 2;
    }
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-label {
    display: block;
    font-size: var(--font-xs);
    font-weight: 700;
    color: var(--brand-navy);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.required-asterisk {
    color: #DC2626;
    margin-left: 3px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 14px;
    color: var(--text-muted);
    pointer-events: none;
    z-index: 2;
}

/* Input Field Styling & Error State */
.form-input,
.input-wrapper input {
    width: 100%;
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid var(--border-color);
    padding: 12px 14px 12px 42px;
    border-radius: var(--radius-sm);
    font-size: var(--font-sm);
    color: var(--text-main);
    font-weight: 600;
    outline: none;
    transition: all 0.2s ease;
}

.form-input:focus,
.input-wrapper input:focus {
    border-color: var(--brand-gold);
    background: #FFFFFF;
    box-shadow: 0 0 0 3px rgba(198, 138, 0, 0.18);
}

.input-wrapper input.input-error {
    border-color: #DC2626 !important;
    background-color: #FEF2F2 !important;
}

.toggle-password-btn {
    position: absolute;
    right: 14px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    z-index: 2;
}

/* Validation Feedback */
.field-error-msg {
    color: #DC2626;
    font-size: 13px;
    font-weight: 600;
    margin-top: 5px;
}

.field-help-text {
    color: var(--text-muted);
    font-size: 12px;
    margin-top: 4px;
    line-height: 1.4;
}

.alert-danger {
    background-color: #FEF2F2;
    border: 1px solid #FCA5A5;
    color: #DC2626;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 20px;
    grid-column: span 2;
}

/* Terms & Submit Button */
.terms-group {
    margin-top: 10px;
    margin-bottom: 20px;
    font-size: var(--font-xs);
    color: var(--text-muted);
    font-weight: 600;
}

.terms-label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    cursor: pointer;
    line-height: 1.4;
}

.terms-label input[type="checkbox"] {
    accent-color: var(--brand-navy);
    width: 16px;
    height: 16px;
    margin-top: 1px;
}

.btn-submit {
    width: 100%;
    background: var(--brand-gold);
    color: var(--brand-navy);
    border: none;
    padding: 14px;
    border-radius: var(--radius-sm);
    font-size: var(--font-base);
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: background 0.2s ease, transform 0.1s ease;
    box-shadow: 0 4px 12px rgba(198, 138, 0, 0.2);
}

.btn-submit:hover {
    background: var(--brand-gold-hover);
    transform: translateY(-1px);
}

.auth-footer {
    text-align: center;
    margin-top: 20px;
    font-size: var(--font-sm);
    color: var(--text-muted);
    font-weight: 600;
}

.auth-footer a {
    color: var(--brand-navy);
    text-decoration: none;
    font-weight: 800;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* Custom Alert Popup Toast */
.error-toast {
    position: fixed;
    top: 24px;
    right: 24px;
    background: #991B1B;
    color: #FFFFFF;
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 1000;
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
    max-width: 90vw;
}

.error-toast.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.error-toast-text {
    font-size: 14px;
    font-weight: 700;
}
