/* Auth pages — GeoPower / Rassam brand */
:root {
    --brand-navy: #1a2a6c;
    --brand-navy-deep: #0f1a45;
    --brand-orange: #f39a2e;
    --brand-orange-hot: #e88712;
    --ink: #1c2434;
    --muted: #5c6b7a;
    --surface: #ffffff;
    --line: #d8e0ea;
    --danger: #b42318;
    --radius: 14px;
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    min-height: 100%;
}

body {
    font-family: 'IRANSans', Tahoma, sans-serif;
    color: var(--ink);
    direction: rtl;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 24px;
    background:
        radial-gradient(ellipse 80% 60% at 15% 20%, rgba(243, 154, 46, 0.18), transparent 55%),
        radial-gradient(ellipse 70% 50% at 90% 85%, rgba(26, 42, 108, 0.22), transparent 50%),
        linear-gradient(155deg, #e8eef6 0%, #f4f6fa 45%, #dfe7f2 100%);
    background-attachment: fixed;
    position: relative;
    overflow-x: hidden;
}

/* Subtle map-grid atmosphere */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    opacity: 0.35;
    background-image:
        linear-gradient(rgba(26, 42, 108, 0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(26, 42, 108, 0.06) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse 70% 70% at 50% 50%, #000 30%, transparent 100%);
}

.login-container,
.otp-container {
    position: relative;
    z-index: 1;
    display: flex;
    width: min(920px, 100%);
    min-height: 520px;
    background: var(--surface);
    border: 1px solid rgba(26, 42, 108, 0.08);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 18px 40px rgba(15, 26, 69, 0.12);
    animation: panelIn 0.7s var(--ease) both;
}

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

.left-section {
    width: 44%;
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px 32px;
    text-align: center;
    background:
        linear-gradient(165deg, var(--brand-navy) 0%, var(--brand-navy-deep) 55%, #152258 100%);
    position: relative;
}

.left-section::after {
    content: "";
    position: absolute;
    inset: auto -20% -30% auto;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: var(--brand-orange);
    opacity: 0.18;
    filter: blur(2px);
}

.brand {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    max-width: 280px;
}

.brand-logo {
    width: 108px;
    height: auto;
    display: block;
    filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.25));
    animation: logoIn 0.85s var(--ease) 0.12s both;
}

@keyframes logoIn {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.94);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.brand h1 {
    font-size: 1.65rem;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: 0.01em;
    color: #fff;
}

.brand h1 .product-version {
    display: block;
    margin-top: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--brand-orange);
}

.brand h2 {
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.9);
}

.brand p {
    font-size: 0.92rem;
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.72);
}

.brand .toe-url {
    font-size: 0.75rem;
    opacity: 0.55;
    word-break: break-all;
    direction: ltr;
}

.right-section {
    width: 56%;
    padding: 44px 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: var(--surface);
    animation: formIn 0.75s var(--ease) 0.18s both;
}

@keyframes formIn {
    from {
        opacity: 0;
        transform: translateX(-12px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.right-section h2,
.right-section h3 {
    color: var(--brand-navy);
    font-size: 1.45rem;
    font-weight: 700;
    margin-bottom: 8px;
    text-align: right;
}

.right-section .form-lead {
    color: var(--muted);
    font-size: 0.92rem;
    margin-bottom: 24px;
    line-height: 1.6;
}

form {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

form p {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 14px;
}

form label {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--ink);
    text-align: right;
}

form input[type="text"],
form input[type="password"],
form input[type="email"],
form input:not([type="hidden"]):not([type="submit"]):not([type="checkbox"]):not([type="radio"]) {
    width: 100%;
    padding: 12px 14px;
    font-size: 0.95rem;
    font-family: inherit;
    color: var(--ink);
    background: #f7f9fc;
    border: 1px solid var(--line);
    border-radius: 8px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

form input:focus {
    outline: none;
    background: #fff;
    border-color: var(--brand-orange);
    box-shadow: 0 0 0 3px rgba(243, 154, 46, 0.2);
}

form .helptext,
form .help-text {
    font-size: 0.78rem;
    color: var(--muted);
}

/* Captcha row */
form .captcha {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

form img.captcha,
#id_captcha_0,
.captcha img {
    border-radius: 6px;
    border: 1px solid var(--line);
}

.form-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 8px;
}

.btn-login {
    appearance: none;
    width: 100%;
    background: var(--brand-orange);
    color: #fff;
    padding: 13px 16px;
    font-size: 1rem;
    font-weight: 700;
    font-family: inherit;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s var(--ease);
}

.btn-login:hover {
    background: var(--brand-orange-hot);
    transform: translateY(-1px);
}

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

.btn-register {
    display: block;
    text-align: center;
    color: var(--brand-navy);
    font-weight: 600;
    font-size: 0.92rem;
    text-decoration: none;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid var(--line);
    transition: background 0.2s ease, border-color 0.2s ease;
}

.btn-register:hover {
    background: #f3f6fb;
    border-color: #b8c5d6;
}

.messages,
.error {
    margin-bottom: 16px;
    padding: 12px 14px;
    border-radius: 8px;
    background: #fff4f2;
    border: 1px solid #f0c4be;
    color: var(--danger);
    font-size: 0.9rem;
    line-height: 1.5;
}

.messages p,
.error p {
    margin: 0;
}

body > .messages {
    position: fixed;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 20;
    min-width: min(420px, 90vw);
    box-shadow: 0 8px 24px rgba(15, 26, 69, 0.12);
}

@media (max-width: 768px) {
    body {
        padding: 16px;
        align-items: flex-start;
    }

    .login-container,
    .otp-container {
        flex-direction: column;
        min-height: unset;
        width: 100%;
    }

    .left-section,
    .right-section {
        width: 100%;
    }

    .left-section {
        padding: 28px 20px 24px;
    }

    .brand-logo {
        width: 88px;
    }

    .right-section {
        padding: 28px 22px 32px;
        animation: formIn 0.75s var(--ease) 0.18s both;
    }

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