@import url('https://fonts.googleapis.com/css2?family=Newsreader:wght@500;600;700&family=Roboto:wght@400;500;700&display=swap');

:root {
    --papiro-blue: #053EC9;
    --papiro-blue-strong: #0433a8;
}

html {
    box-sizing: border-box;
}

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

body.papiro-login {
    min-height: 100vh;
    margin: 0;
    font-family: 'Roboto', 'Segoe UI', sans-serif;
    color: #1e293b;
}

.page-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: clamp(1rem, 2.8vw, 2.5rem);
    position: relative;
    overflow: hidden;


}

.login-wrapper {
    display: flex;
    width: min(100%, 954px);
    min-height: min(500px, calc(100vh - 2rem));
    border-radius: 28px;
    overflow: hidden;
    background: #ffffff;
    box-shadow: 0 28px 80px rgba(37, 99, 235, 0.14), 0 6px 24px rgba(15, 23, 42, 0.08);
    position: relative;
    z-index: 1;
    margin: 0 auto;
}

.login-brand {
    flex: 1;
    background:
        radial-gradient(circle at top right, rgba(255, 255, 255, 0.16), transparent 24%),
        linear-gradient(155deg, var(--papiro-blue-strong) 0%, var(--papiro-blue) 58%, #032a8d 100%);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: space-between;
    padding: 2.55rem 2.8rem;
    gap: 1.1rem;
    position: relative;
    overflow: hidden;
    min-width: 0;
}

.login-brand::before {
    content: '';
    position: absolute;
    top: -80px;
    right: -80px;
    width: 260px;
    height: 260px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
}

.login-brand::after {
    content: '';
    position: absolute;
    bottom: -60px;
    left: -60px;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
}

.brand-kicker {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.45rem 0.8rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: rgba(255, 255, 255, 0.92);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    position: relative;
    z-index: 2;
}

.brand-logo {
    width: 340px;
    max-width: 100%;
    filter: brightness(0) invert(1);
    position: relative;
    z-index: 2;
}

.brand-divider {
    width: 40px;
    height: 2px;
    background: rgba(255, 255, 255, 0.32);
    border-radius: 2px;
    position: relative;
    z-index: 2;
}

.brand-tagline {
    color: rgba(255, 255, 255, 0.92);
    font-family: 'Newsreader', Georgia, serif;
    font-size: 1.45rem;
    font-weight: 600;
    text-align: left;
    max-width: 420px;
    line-height: 1.35;
    position: relative;
    z-index: 2;
}

.brand-highlights {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    width: 100%;
    position: relative;
    z-index: 2;
}

.brand-highlight-item {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    color: rgba(255, 255, 255, 0.88);
    font-size: 0.92rem;
    line-height: 1.5;
}

.brand-highlight-item .pi {
    font-size: 1rem;
    margin-top: 0.15rem;
    color: rgba(255, 255, 255, 0.98);
}

.brand-document-card {
    width: min(100%, 420px);
    padding: 1.15rem 1.15rem 1rem;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.16);
    box-shadow: 0 18px 40px rgba(0, 23, 84, 0.16);
    backdrop-filter: blur(10px);
    position: relative;
    z-index: 2;
}

.document-card-label {
    display: inline-flex;
    margin-bottom: 0.65rem;
    color: rgba(255, 255, 255, 0.76);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.document-card-title {
    display: block;
    color: #ffffff;
    font-family: 'Newsreader', Georgia, serif;
    font-size: 1.2rem;
    line-height: 1.35;
    margin-bottom: 0.85rem;
}

.document-card-lines {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.document-card-lines span {
    display: block;
    height: 7px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.26);
}

.document-card-lines span:nth-child(1) {
    width: 100%;
}

.document-card-lines span:nth-child(2) {
    width: 82%;
}

.document-card-lines span:nth-child(3) {
    width: 68%;
}

.login-form-panel {
    flex: 1.08;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, #f8fbff 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: clamp(1.7rem, 2.6vw, 2.55rem) clamp(2rem, 3vw, 3rem);
    position: relative;
    overflow: hidden;
    min-width: 0;
}

.mobile-brand {
    display: none;
    align-items: center;
    gap: 0.9rem;
    margin-bottom: 1.5rem;
}

.mobile-brand img {
    width: 152px;
    height: auto;
}

.mobile-brand-text {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.mobile-brand-title {
    font-family: 'Newsreader', Georgia, serif;
    font-size: 1.55rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    color: #1e293b;
}

.mobile-brand-subtitle {
    font-size: 0.84rem;
    color: #475569;
    line-height: 1.45;
}

.form-eyebrow {
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.11em;
    text-transform: uppercase;
    color: #2563eb;
    margin-bottom: 0.65rem;
}

.form-title {
    font-family: 'Newsreader', Georgia, serif;
    font-size: 2.35rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 0.5rem 0;
    line-height: 1.08;
}

.form-subtitle {
    font-size: 1rem;
    color: #475569;
    margin: 0 0 1.9rem 0;
    line-height: 1.65;
    max-width: 32rem;
}

.alert-box {
    display: none;
    align-items: flex-start;
    gap: 0.75rem;
    border: 1px solid #fecaca;
    background: #fef2f2;
    color: #991b1b;
    border-radius: 12px;
    padding: 0.9rem 1rem;
    margin-bottom: 1rem;
    font-size: 0.92rem;
    line-height: 1.5;
}

.alert-box.show {
    display: flex;
}

.alert-box .pi {
    font-size: 1rem;
    margin-top: 0.1rem;
    flex-shrink: 0;
}

.field-group {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
    margin-bottom: 1.5rem;
}

.field-wrap {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.field-label {
    font-size: 0.86rem;
    font-weight: 600;
    color: #334155;
    letter-spacing: 0.02em;
}

.field-input-row {
    display: flex;
    align-items: center;
    border: 1.5px solid #d7e2f1;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.92);
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
    overflow: hidden;
}

.field-input-row:focus-within {
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.14);
    background: #ffffff;
}

.field-input-row.has-error {
    border-color: #dc2626;
    background: #fffafa;
}

.field-input-row.has-error:focus-within {
    box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.12);
}

.field-icon {
    padding: 0 0.9rem;
    color: #6b7280;
    font-size: 1rem;
    flex-shrink: 0;
}

.field-input-row:focus-within .field-icon {
    color: #2563eb;
}

.field-input {
    width: 100%;
    border: none;
    outline: none;
    background: transparent;
    padding: 0.92rem 0.4rem 0.92rem 0;
    font-size: 0.95rem;
    color: #0f1635;
    min-width: 0;
}

.field-input::placeholder {
    color: #6b7280;
}

.toggle-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0 0.95rem;
    color: #6b7280;
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    transition: color 0.2s;
}

.toggle-btn:hover {
    color: #2563eb;
}

.toggle-btn:focus-visible,
.btn-login:focus-visible,
.public-link-item:focus-visible {
    outline: 3px solid rgba(37, 99, 235, 0.24);
    outline-offset: 2px;
}

.field-help {
    min-height: 1rem;
    font-size: 0.78rem;
    color: #dc2626;
    line-height: 1.4;
}

.caps-lock-hint {
    display: none;
    font-size: 0.78rem;
    color: #b45309;
    line-height: 1.4;
}

.caps-lock-hint.show {
    display: block;
}

.btn-login {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 0.92rem 1.5rem;
    background: var(--papiro-blue);
    color: #ffffff;
    border: none;
    border-radius: 14px;
    font-size: 0.96rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s, box-shadow 0.2s, opacity 0.2s;
    box-shadow: 0 12px 22px rgba(5, 62, 201, 0.28);
    margin-bottom: 1.35rem;
    letter-spacing: 0.04em;
    min-height: 48px;
}

.btn-login:hover {
    background: var(--papiro-blue-strong);
    box-shadow: 0 14px 26px rgba(4, 51, 168, 0.3);
    transform: translateY(-1px);
}

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

.btn-login[disabled] {
    cursor: not-allowed;
    opacity: 0.82;
    transform: none;
}

.btn-spinner {
    width: 1rem;
    height: 1rem;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: none;
}

.btn-login.loading .btn-spinner {
    display: inline-block;
}

.btn-login.loading .btn-text-default {
    display: none;
}

.btn-login.loading .btn-text-loading {
    display: inline;
}

.btn-text-loading {
    display: none;
}

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

.public-links {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    border-top: 1px solid rgba(148, 163, 184, 0.22);
    padding-top: 1.3rem;
}

.public-links-label {
    font-size: 0.8rem;
    color: #4b5563;
    font-weight: 600;
}

.public-link-item {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    font-size: 0.92rem;
    color: #2563eb;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.15s, background 0.15s;
    width: fit-content;
    border-radius: 999px;
    padding: 0.35rem 0.55rem 0.35rem 0;
}

.public-link-item:hover {
    color: #1d4ed8;
    background: rgba(37, 99, 235, 0.06);
    text-decoration: none;
}

.public-link-item .pi {
    font-size: 0.92rem;
    opacity: 0.85;
}

/* Responsive */
@media (max-width: 860px) {
    .page-shell {
        padding: 1.25rem;
    }

    .login-wrapper {
        width: min(100%, 42rem);
        min-height: auto;
    }

    .login-brand {
        display: none;
    }

    .login-form-panel {
        width: 100%;
        padding: 2rem 1.35rem;
    }

    .mobile-brand {
        display: flex;
    }

    .form-title {
        font-size: 1.85rem;
    }

    .form-subtitle {
        max-width: none;
    }
}

@media (max-width: 480px) {
    .page-shell {
        padding: 0.9rem;
    }

    .login-wrapper {
        width: 100%;
        border-radius: 16px;
    }

    .login-form-panel {
        padding: 1.5rem 1rem;
    }

    .form-title {
        font-size: 1.65rem;
    }

    .form-subtitle {
        font-size: 0.9rem;
    }

    .mobile-brand {
        margin-bottom: 1.15rem;
    }

    .mobile-brand img {
        width: 132px;
    }

    .mobile-brand-title {
        font-size: 1.35rem;
    }

    .public-link-item {
        width: 100%;
        justify-content: flex-start;
    }
}

@media (min-width: 861px) and (max-width: 1180px) {
    .page-shell {
        padding: 1.5rem;
    }

    .login-wrapper {
        width: min(100%, 882px);
        min-height: min(485px, calc(100vh - 3rem));
    }

    .login-brand {
        padding: 2.2rem;
    }

    .login-form-panel {
        padding: 1.9rem 2rem;
    }

    .brand-logo {
        width: 300px;
    }

    .brand-tagline {
        font-size: 1.28rem;
    }
}

@media (min-width: 1440px) {
    .page-shell {
        padding: 2.75rem;
    }

    .login-wrapper {
        width: min(100%, 1062px);
        min-height: min(565px, calc(100vh - 5.5rem));
    }

    .login-brand {
        padding: 2.9rem 3rem;
    }

    .login-form-panel {
        padding: 2.9rem 3rem;
    }

    .brand-logo {
        width: 380px;
    }

    .brand-tagline {
        max-width: 460px;
        font-size: 1.58rem;
    }

    .form-title {
        font-size: 2.6rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}