﻿/* Login — palette from Akin logo (navy + teal) */
:root {
    --login-navy: #003c60;
    --login-navy-mid: #0c3c60;
    --login-navy-light: #186078;
    --login-orange: #248484;
    --login-orange-deep: #1a6c6c;
    --login-orange-soft: #3cb4b8;
    --login-orange-glow: rgba(36, 132, 132, 0.35);
    --login-cream: #f3f7f9;
    --login-panel: #ffffff;
    --login-input-bg: #f0f5f7;
    --login-border: #d5e0e6;
    --login-text: #1a2f3d;
    --login-muted: #5c7380;
    --font-fa: "Estedad", "Vazirmatn", Tahoma, sans-serif;
    --font-display: "Estedad", "Vazirmatn", system-ui, sans-serif;
}

@font-face {
    font-family: "Estedad";
    src: url("../fonts/Estedad-wght.woff2") format("woff2");
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

.login-page {
    margin: 0;
    width: 100%;
    max-width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    font-family: var(--font-fa);
    color: var(--login-text);
    background: var(--login-navy);
    overflow-x: hidden;
}

/* Simple auth pages (SignUp / ForgotPassword) without split shell */
.login-page:not(:has(.login-shell)) {
    background:
        radial-gradient(ellipse 70% 50% at 15% 0%, rgba(36, 132, 132, 0.22), transparent 55%),
        linear-gradient(160deg, var(--login-navy) 0%, var(--login-navy-mid) 55%, #16324f 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
}

.login-page:not(:has(.login-shell)) .login-container {
    width: 100%;
    max-width: 420px;
}

.login-page:not(:has(.login-shell)) .login-card {
    animation: loginRise 0.55s ease-out both;
}

.login-shell {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    width: 100%;
    max-width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
}

/* ——— Promo / brand side (hero photo) ——— */
.login-promo {
    position: relative;
    overflow: hidden;
    background: #0a1628;
    color: #f5f8fc;
    padding: clamp(1.5rem, 4vw, 3rem);
    display: flex;
    align-items: stretch;
}

.login-promo-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 35%;
    z-index: 0;
    pointer-events: none;
}

.login-promo-scrim {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background:
        linear-gradient(180deg, rgba(8, 18, 34, 0.55) 0%, rgba(8, 18, 34, 0.35) 42%, rgba(8, 18, 34, 0.78) 100%),
        radial-gradient(ellipse 70% 55% at 70% 40%, rgba(14, 116, 180, 0.18), transparent 65%);
}

.login-promo-glow {
    position: absolute;
    inset: auto -15% -25% auto;
    width: 50%;
    height: 50%;
    z-index: 1;
    background: radial-gradient(circle, rgba(36, 132, 132, 0.22), transparent 70%);
    pointer-events: none;
    animation: loginGlow 8s ease-in-out infinite alternate;
}

.login-promo-inner {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    max-width: 560px;
    margin-inline: auto;
    width: 100%;
    animation: loginRise 0.7s ease-out both;
}

.login-promo-logo-link {
    display: block;
    margin-bottom: 1.35rem;
    line-height: 0;
    text-decoration: none;
    transform: translateY(-50%);
}

.login-promo-logo {
    width: clamp(210px, 28vw, 300px);
    height: auto;
    max-height: clamp(210px, 28vw, 300px);
    object-fit: contain;
    background: transparent;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
    filter: none;
}

.login-promo-headline {
    font-family: var(--font-display);
    font-size: clamp(1.55rem, 2.8vw, 2.15rem);
    font-weight: 700;
    line-height: 1.25;
    margin: 0 0 0.85rem;
    color: #fff;
    text-shadow: 0 2px 16px rgba(0, 0, 0, 0.35);
}

.login-promo-sub {
    margin: 0 0 1.75rem;
    font-size: 1.02rem;
    line-height: 1.65;
    color: rgba(226, 232, 240, 0.92);
    max-width: 36ch;
}

.login-promo-features {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.65rem;
    width: 100%;
    text-align: start;
}

.login-promo-features li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 0.9rem;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.16);
    color: #f8fafc;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.18);
    animation: loginRise 0.7s ease-out both;
}

.login-promo-features li:nth-child(1) { animation-delay: 0.08s; }
.login-promo-features li:nth-child(2) { animation-delay: 0.16s; }
.login-promo-features li:nth-child(3) { animation-delay: 0.24s; }
.login-promo-features li:nth-child(4) { animation-delay: 0.32s; }

.login-promo-features i {
    width: 2rem;
    height: 2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: rgba(36, 132, 132, 0.14);
    color: var(--login-orange);
    font-size: 1rem;
    flex-shrink: 0;
}

.login-promo-footer {
    margin-top: auto;
    padding-top: 2.5rem;
    font-size: 0.8rem;
    color: rgba(203, 213, 225, 0.85);
}

/* ——— Form panel (dark) ——— */
.login-panel {
    position: relative;
    background:
        radial-gradient(ellipse 80% 55% at 20% 0%, rgba(36, 132, 132, 0.22), transparent 55%),
        radial-gradient(ellipse 70% 50% at 90% 90%, rgba(42, 80, 128, 0.45), transparent 50%),
        linear-gradient(155deg, var(--login-navy) 0%, var(--login-navy-mid) 48%, #16324f 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(1.25rem, 3vw, 2.5rem);
}

.login-panel-stack {
    width: 100%;
    max-width: 420px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 1.1rem;
    animation: loginRise 0.65s ease-out 0.1s both;
}

/* Analog clock + date — top corner near panel divider */
.login-clock-block {
    position: absolute;
    top: 1rem;
    inset-inline-start: 1rem;
    z-index: 4;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.45rem;
    pointer-events: none;
}

.login-analog-clock {
    width: 88px;
    height: 88px;
}

.login-clock-face {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background:
        radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.18), transparent 45%),
        linear-gradient(160deg, #1a3f66 0%, #0c223b 100%);
    border: 3px solid rgba(255, 255, 255, 0.22);
    box-shadow:
        0 0 0 4px rgba(36, 132, 132, 0.2),
        0 12px 28px rgba(0, 0, 0, 0.35);
}

.login-clock-mark {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 2px;
    height: 6px;
    margin-left: -1px;
    background: rgba(255, 255, 255, 0.55);
    border-radius: 1px;
    transform-origin: 50% 0;
    transform: rotate(calc(var(--m) * 30deg)) translateY(-37px);
}

.login-clock-mark:nth-child(3),
.login-clock-mark:nth-child(6),
.login-clock-mark:nth-child(9),
.login-clock-mark:nth-child(12) {
    height: 9px;
    width: 3px;
    margin-left: -1.5px;
    background: var(--login-orange-soft);
    transform: rotate(calc(var(--m) * 30deg)) translateY(-36px);
}

.login-clock-hand {
    position: absolute;
    left: 50%;
    bottom: 50%;
    transform-origin: 50% 100%;
    border-radius: 3px;
    background: #fff;
}

.login-clock-hour {
    width: 3px;
    height: 22px;
    margin-left: -1.5px;
    background: #fff;
}

.login-clock-minute {
    width: 2.5px;
    height: 28px;
    margin-left: -1.25px;
    background: rgba(255, 255, 255, 0.92);
}

.login-clock-second {
    width: 1.5px;
    height: 32px;
    margin-left: -0.75px;
    background: var(--login-orange);
}

.login-clock-center {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 10px;
    height: 10px;
    margin: -5px 0 0 -5px;
    border-radius: 50%;
    background: var(--login-orange);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.35);
}

.login-clock-date {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.78rem;
    font-weight: 600;
    text-align: center;
    letter-spacing: 0.01em;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.25);
    max-width: 9.5rem;
    line-height: 1.35;
}

.login-lang {
    position: absolute;
    top: 1rem;
    inset-inline-end: 1rem;
    display: flex;
    gap: 0.35rem;
    z-index: 5;
}

.login-lang a {
    padding: 0.4rem 0.75rem;
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
    font-size: 0.82rem;
    border-radius: 999px;
    border: 1px solid transparent;
    transition: color 0.2s, background 0.2s, border-color 0.2s;
}

.login-lang a:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
}

.login-lang a.active {
    color: #fff;
    background: var(--login-orange);
    border-color: var(--login-orange);
}

.login-card {
    width: 100%;
    background: var(--login-panel);
    border-radius: 20px;
    padding: clamp(1.75rem, 3vw, 2.4rem);
    border: 1px solid rgba(15, 39, 68, 0.08);
    box-shadow:
        0 4px 6px rgba(15, 39, 68, 0.04),
        0 18px 40px rgba(15, 39, 68, 0.1);
}

.login-welcome {
    margin: 0 0 0.25rem;
    font-size: 0.9rem;
    color: var(--login-muted);
}

.login-title {
    margin: 0 0 1.5rem;
    font-family: var(--font-display);
    font-size: 1.65rem;
    font-weight: 700;
    color: var(--login-navy);
}

.login-already {
    text-align: center;
    color: var(--login-muted);
    margin-bottom: 1rem;
}

.form-group-login {
    margin-bottom: 1rem;
}

.form-label-login {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--login-navy-mid);
    margin-bottom: 0.35rem;
}

.form-input-wrap {
    position: relative;
}

.form-input {
    width: 100%;
    padding: 0.8rem 2.6rem 0.8rem 0.95rem;
    background: var(--login-input-bg);
    border: 1px solid var(--login-border);
    border-radius: 12px;
    color: var(--login-text);
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

[dir="ltr"] .form-input {
    padding: 0.8rem 0.95rem 0.8rem 2.6rem;
}

.form-input::placeholder {
    color: #8a97a8;
}

.form-input:focus {
    outline: none;
    border-color: var(--login-orange);
    background: #fff;
    box-shadow: 0 0 0 3px var(--login-orange-glow);
}

.input-icon {
    position: absolute;
    inset-inline-end: 0.95rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--login-muted);
    font-size: 1.05rem;
    pointer-events: none;
}

[dir="ltr"] .input-icon {
    inset-inline-end: auto;
    inset-inline-start: 0.95rem;
}

.form-row-login {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 1.15rem;
}

.form-check-login {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.form-check-login .form-check-input {
    width: 1.05rem;
    height: 1.05rem;
    margin: 0;
    accent-color: var(--login-orange);
    cursor: pointer;
}

.form-check-login .form-check-label {
    color: var(--login-text);
    font-size: 0.88rem;
    cursor: pointer;
    user-select: none;
}

.forgot-link {
    color: var(--login-orange);
    font-size: 0.85rem;
    text-decoration: none;
    font-weight: 600;
}

.forgot-link:hover {
    color: var(--login-orange-deep);
    text-decoration: underline;
}

.login-error {
    color: #c0392b;
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
    text-align: center;
}

.btn-login {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 0.9rem 1.5rem;
    background: linear-gradient(135deg, var(--login-orange) 0%, var(--login-orange-deep) 100%);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 8px 22px var(--login-orange-glow);
    transition: transform 0.2s, box-shadow 0.2s, filter 0.2s;
}

.btn-login:hover {
    transform: translateY(-1px);
    filter: brightness(1.05);
    box-shadow: 0 12px 28px var(--login-orange-glow);
    color: #fff;
}

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

.login-links {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.55rem;
    margin-top: 1.35rem;
}

.signup-link {
    color: var(--login-navy);
    font-size: 0.92rem;
    font-weight: 600;
    text-decoration: none;
}

.signup-link:hover {
    color: var(--login-orange);
}

.signup-link-muted {
    color: var(--login-muted);
    font-weight: 500;
    font-size: 0.85rem;
}

.login-version {
    margin-top: 1.25rem;
    text-align: center;
    font-size: 0.78rem;
    color: var(--login-muted);
}

.login-version a {
    color: inherit;
    text-decoration: none;
}

.login-version a:hover {
    color: var(--login-orange);
}

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

@keyframes loginGlow {
    from { opacity: 0.55; transform: scale(1); }
    to { opacity: 0.9; transform: scale(1.08); }
}

/* Mobile / tablet: stack vertically — form first, compact promo.
   Also apply for touch phones in portrait when WebView reports a wide layout viewport. */
@media (max-width: 900px), ((hover: none) and (pointer: coarse) and (orientation: portrait) and (max-width: 1100px)) {
    .login-shell {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto;
        min-height: 100vh;
        min-height: 100dvh;
    }

    /* Form panel first so login is above the fold */
    .login-panel {
        order: -1;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        gap: 0.85rem;
        padding: 1rem 1rem 1.5rem;
        min-height: auto;
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }

    .login-promo {
        order: 1;
        min-height: 280px;
        width: 100%;
        max-width: 100%;
        padding: 1.1rem 1rem 1.35rem;
    }

    .login-promo-bg {
        object-position: center 28%;
    }

    .login-promo-inner {
        max-width: none;
    }

    .login-promo-logo-link {
        margin-bottom: 0.75rem;
        transform: translateY(-50%);
    }

    .login-promo-logo {
        width: min(140px, 36vw);
        max-height: min(140px, 36vw);
    }

    .login-promo-headline {
        font-size: 1.2rem;
        margin-bottom: 0.45rem;
    }

    .login-promo-sub {
        margin-bottom: 0.85rem;
        font-size: 0.88rem;
        max-width: none;
    }

    .login-promo-features {
        grid-template-columns: 1fr 1fr;
        gap: 0.45rem;
    }

    .login-promo-features li {
        padding: 0.5rem 0.55rem;
        font-size: 0.78rem;
    }

    .login-promo-footer {
        display: none;
    }

    .login-lang {
        position: static;
        justify-content: center;
        flex-wrap: wrap;
        margin: 0;
        inset-inline-end: auto;
        top: auto;
    }

    .login-clock-block {
        position: static;
        margin: 0 auto;
        inset-inline-start: auto;
        top: auto;
        pointer-events: none;
    }

    .login-analog-clock {
        width: 64px;
        height: 64px;
    }

    .login-clock-mark {
        transform: rotate(calc(var(--m) * 30deg)) translateY(-26px);
    }

    .login-clock-mark:nth-child(3),
    .login-clock-mark:nth-child(6),
    .login-clock-mark:nth-child(9),
    .login-clock-mark:nth-child(12) {
        transform: rotate(calc(var(--m) * 30deg)) translateY(-25px);
    }

    .login-clock-hour { height: 16px; }
    .login-clock-minute { height: 20px; }
    .login-clock-second { height: 24px; }

    .login-clock-date {
        font-size: 0.72rem;
        max-width: 12rem;
    }

    .login-panel-stack {
        width: 100%;
        max-width: 420px;
        margin-inline: auto;
        min-width: 0;
    }

    .login-card {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }
}

@media (max-width: 520px) {
    .login-panel {
        padding: 0.85rem 0.85rem 1.25rem;
        gap: 0.65rem;
    }

    /* Hide clock on narrow phones — frees space for the form */
    .login-clock-block {
        display: none;
    }

    .login-promo-sub,
    .login-promo-features {
        display: none;
    }

    .login-promo {
        padding: 0.85rem 1rem 1rem;
    }

    .login-promo-logo {
        width: min(112px, 32vw);
        max-height: min(112px, 32vw);
    }

    .login-promo-headline {
        font-size: 1.05rem;
        margin-bottom: 0;
    }

    .login-card {
        padding: 1.25rem 1rem;
        border-radius: 16px;
    }

    .login-title {
        font-size: 1.35rem;
        margin-bottom: 1.1rem;
    }

    .form-row-login {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.55rem;
    }
}

/* Keep older class hooks used by other auth pages */
.login-container {
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
}

.login-container-wide {
    max-width: 520px;
}

.login-subtitle {
    text-align: center;
    word-break: break-all;
}

.login-brand-meta {
    margin-top: 0.2rem;
    font-size: 0.82rem;
    color: var(--login-muted);
}

.login-brand-company {
    font-weight: 600;
    color: var(--login-orange);
}

.login-brand-sep {
    margin: 0 0.35rem;
    opacity: 0.55;
}

.login-brand-site {
    color: var(--login-navy-light);
}

.login-brand-tagline {
    font-size: 0.78rem !important;
}

.login-brand-compact .login-brand-product {
    font-size: 1.25rem;
}
