:root {
    --auth-bg: #f4f7fb;
    --auth-panel: rgba(255, 255, 255, .97);
    --auth-text: #101828;
    --auth-muted: #667085;
    --auth-line: #d0d5dd;
    --auth-primary: #2563eb;
    --auth-primary-dark: #1d4ed8;
    --auth-primary-soft: #eff6ff;
    --auth-danger: #b42318;
    --auth-danger-soft: #fef3f2;
    --auth-success: #067647;
    --auth-success-soft: #ecfdf3;
    --auth-footer-bg: #ffffff;
    --auth-shadow: 0 30px 60px rgba(16, 24, 40, .12);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: 'Hodoorak Cairo', 'Cairo', Tahoma, Arial, sans-serif;
    color: var(--auth-text);
    background:
        radial-gradient(circle at top right, rgba(37, 99, 235, .15), transparent 24rem),
        radial-gradient(circle at left top, rgba(59, 130, 246, .14), transparent 26rem),
        linear-gradient(180deg, #eef4ff 0%, var(--auth-bg) 42%, #fff 100%);
}

button, input, select { font: inherit; }

.auth-shell {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px 14px 18px;
}

.auth-stage { width: min(100%, 640px); }
.auth-stage--wide { width: min(100%, 860px); }

.auth-card {
    background: var(--auth-panel);
    border: 1px solid rgba(255, 255, 255, .55);
    border-radius: 30px;
    box-shadow: var(--auth-shadow);
    backdrop-filter: blur(12px);
    padding: clamp(22px, 4vw, 34px);
}

.auth-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 18px;
    padding: 9px 12px;
    border-radius: 12px;
    color: var(--auth-primary-dark);
    background: var(--auth-primary-soft);
    font-size: 14px;
    font-weight: 800;
    text-decoration: none;
}

.auth-back:hover { background: #dbeafe; }
.auth-back svg { width: 18px; height: 18px; }

.auth-logo {
    width: 112px;
    height: 136px;
    margin: 0 auto 14px;
}

.auth-logo img { width: 100%; height: 100%; object-fit: contain; }
.auth-heading { margin-bottom: 22px; text-align: center; }
.auth-kicker { margin-bottom: 10px; color: var(--auth-primary); font-size: 13px; font-weight: 800; }
.auth-title { margin: 0; font-size: clamp(26px, 4vw, 32px); line-height: 1.35; }
.auth-subtitle { margin: 10px auto 0; max-width: 640px; color: var(--auth-muted); font-size: 15px; line-height: 1.9; }

.auth-alert { border-radius: 18px; padding: 14px 16px; margin-bottom: 18px; line-height: 1.8; }
.auth-alert--error { color: var(--auth-danger); background: var(--auth-danger-soft); border: 1px solid rgba(180, 35, 24, .16); }
.auth-alert--success { color: var(--auth-success); background: var(--auth-success-soft); border: 1px solid rgba(6, 118, 71, .16); }
.auth-alert ul { margin: 0; padding-right: 18px; }

.auth-notice {
    margin: 0 0 20px;
    padding: 14px 16px;
    border: 1px solid #bfdbfe;
    border-radius: 18px;
    color: #1e40af;
    background: var(--auth-primary-soft);
    line-height: 1.8;
}

.auth-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.auth-field { margin-bottom: 14px; }
.auth-grid .auth-field { margin: 0; }
.auth-field--full { grid-column: 1 / -1; }
.auth-field label { display: block; margin-bottom: 8px; font-size: 14px; font-weight: 800; }

.auth-field input,
.auth-field select {
    width: 100%;
    min-height: 50px;
    border: 1px solid var(--auth-line);
    border-radius: 16px;
    padding: 12px 14px;
    background: #fff;
    color: var(--auth-text);
    outline: none;
}

.auth-field input:focus,
.auth-field select:focus {
    border-color: rgba(37, 99, 235, .7);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, .12);
}

.auth-help { display: block; margin-top: 6px; color: var(--auth-muted); font-size: 12px; line-height: 1.7; }
.auth-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 8px 0 18px; color: var(--auth-muted); font-size: 14px; }
.auth-check { display: flex; align-items: flex-start; gap: 9px; line-height: 1.8; cursor: pointer; }
.auth-check input { width: 18px; height: 18px; margin-top: 4px; accent-color: var(--auth-primary); flex: 0 0 auto; }
.auth-link { color: var(--auth-primary-dark); font-weight: 800; text-decoration: none; }
.auth-link:hover { text-decoration: underline; }

.auth-submit {
    width: 100%;
    border: 0;
    border-radius: 18px;
    padding: 14px 18px;
    color: #fff;
    background: linear-gradient(135deg, var(--auth-primary), var(--auth-primary-dark));
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 16px 30px rgba(37, 99, 235, .24);
    transition: transform .15s ease, box-shadow .15s ease;
}

.auth-submit:hover { transform: translateY(-1px); box-shadow: 0 18px 34px rgba(37, 99, 235, .28); }
.auth-submit--register { margin-top: 18px; }
.auth-note { margin-top: 18px; text-align: center; color: var(--auth-muted); font-size: 13px; line-height: 1.9; }

body > .hdoorak-project-footer--guest {
    position: relative;
    z-index: 1;
    flex: 0 0 auto;
    width: 100%;
    margin: 0;
    padding: 0 20px;
    color: var(--auth-muted);
    background-color: var(--auth-footer-bg);
    background-image: none;
    border-top: 1px solid #e4e7ec;
    font-size: 12px;
    isolation: isolate;
}

.hdoorak-project-footer--guest .hdoorak-project-footer__inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 18px;
    width: min(100%, 1180px);
    min-height: 66px;
    margin: 0 auto;
    padding: 14px 0;
}

.hdoorak-project-footer--guest .hdoorak-project-footer__identity,
.hdoorak-project-footer--guest .hdoorak-project-footer__legal {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
}

.hdoorak-project-footer--guest .hdoorak-project-footer__identity {
    justify-self: start;
}

.hdoorak-project-footer--guest .hdoorak-project-footer__legal {
    justify-self: end;
}

.hdoorak-project-footer--guest .hdoorak-project-footer__brand {
    color: var(--auth-text);
    font-weight: 900;
}

.hdoorak-project-footer--guest .hdoorak-project-footer__version {
    padding: 4px 8px;
    border-radius: 999px;
    color: var(--auth-primary-dark);
    background: var(--auth-primary-soft);
    font-weight: 800;
}

.hdoorak-project-footer--guest a {
    color: var(--auth-muted);
    font-weight: 800;
    text-decoration: none;
    transition: color .15s ease;
}

.hdoorak-project-footer--guest a:hover {
    color: var(--auth-primary-dark);
}

.hdoorak-project-footer--guest .hdoorak-project-footer__developer {
    justify-self: center;
    color: var(--auth-primary-dark);
    white-space: nowrap;
}

@media (max-width: 680px) {
    .auth-shell { padding-top: 16px; align-items: flex-start; }
    .auth-card { border-radius: 24px; }
    .auth-grid { grid-template-columns: 1fr; }
    .auth-field--full { grid-column: auto; }
    .auth-row { align-items: flex-start; flex-direction: column; }

    body > .hdoorak-project-footer--guest {
        padding: 0 16px;
    }

    .hdoorak-project-footer--guest .hdoorak-project-footer__inner {
        grid-template-columns: 1fr;
        justify-items: center;
        gap: 10px;
        padding: 16px 0;
        text-align: center;
    }

    .hdoorak-project-footer--guest .hdoorak-project-footer__identity,
    .hdoorak-project-footer--guest .hdoorak-project-footer__legal,
    .hdoorak-project-footer--guest .hdoorak-project-footer__developer {
        justify-self: center;
        justify-content: center;
    }
}
