/*
|--------------------------------------------------------------------------
| Rankly authentication stylesheet
|--------------------------------------------------------------------------
|
| Used by index.php (sign in) and create_admin.php (first-run setup).
| Every authenticated page uses assets/app.css instead.
|
| Tokens are kept in step with assets/app.css so the login screen and the
| application read as one product.
|
| 1. Tokens
| 2. Base + accessibility
| 3. Logo
| 4. Split login layout
| 5. Banner (left)
| 6. Auth card (right)
| 7. Messages
| 8. Responsive
|
*/

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

/* ==========================================================================
   1. Tokens
   ========================================================================== */

:root {
    --navy: #102a46;
    --navy-deep: #0c2037;
    --blue: #2f6fe4;
    --blue-dark: #245dc5;
    --blue-soft: #eaf1ff;
    --green: #12966f;
    --green-soft: #e6f7f1;
    --red: #dc4c5b;
    --red-soft: #fff0f2;
    --text: #12243d;
    --text-soft: #45576e;
    --muted: #68778d;
    --line: #dce4ef;
    --background: #f4f7fb;
    --white: #ffffff;
    --shadow: 0 12px 34px rgba(20, 42, 72, 0.08);
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================================================
   2. Base + accessibility
   ========================================================================== */

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body,
button,
input,
select,
textarea {
    font-family: "Manrope", "Segoe UI", system-ui, sans-serif;
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--text);
    background: var(--background);
    font-size: 15px;
    font-weight: 500;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

button,
input {
    font-size: inherit;
}

button {
    cursor: pointer;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

/* Visible keyboard focus — the previous stylesheet suppressed outlines
   with `outline: none` on inputs and never replaced them. */
:focus-visible {
    outline: 3px solid var(--blue);
    outline-offset: 2px;
    border-radius: 6px;
}

.login-banner :focus-visible {
    outline-color: #8fc0ff;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* ==========================================================================
   3. Logo
   ========================================================================== */

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo > span {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    color: var(--white);
    background: linear-gradient(145deg, #4f8cff, #2f6fe4);
    box-shadow: 0 8px 22px rgba(47, 111, 228, 0.3);
    font-size: 21px;
    font-weight: 800;
}

.logo strong,
.logo small {
    display: block;
}

.logo strong {
    color: var(--text);
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.logo small {
    margin-top: 2px;
    color: #8392a6;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.16em;
}

.white-logo strong {
    color: var(--white);
}

.white-logo small {
    color: #91a7c0;
}

/* ==========================================================================
   4. Split login layout
   ========================================================================== */

.auth-page {
    min-height: 100vh;
}

.login-layout {
    display: grid;
    grid-template-columns: minmax(440px, 1.05fr) minmax(440px, 0.95fr);
    min-height: 100vh;
}

/* ==========================================================================
   5. Banner (left)
   ========================================================================== */

.login-banner {
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 100vh;
    padding: 42px clamp(45px, 7vw, 110px);
    color: var(--white);
    background:
        radial-gradient(
            circle at 76% 23%,
            rgba(56, 107, 153, 0.55) 0,
            transparent 31%
        ),
        linear-gradient(145deg, var(--navy-deep), #14304f);
}

.login-banner::before {
    content: "";
    position: absolute;
    top: -160px;
    right: -150px;
    width: 430px;
    height: 430px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 50%;
    box-shadow:
        0 0 0 75px rgba(255, 255, 255, 0.025),
        0 0 0 150px rgba(255, 255, 255, 0.015);
}

.login-banner::after {
    content: "";
    position: absolute;
    bottom: -210px;
    left: -160px;
    width: 430px;
    height: 430px;
    border-radius: 50%;
    background: rgba(47, 111, 228, 0.09);
}

.login-banner .logo,
.banner-content,
.company-text {
    position: relative;
    z-index: 1;
}

.banner-content {
    width: 100%;
    max-width: 540px;
    margin: auto 0;
}

.eyebrow {
    margin-bottom: 9px;
    color: #6f9ff4;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.banner-content h1 {
    max-width: 500px;
    margin: 12px 0 19px;
    color: var(--white);
    font-size: clamp(38px, 4vw, 54px);
    font-weight: 800;
    line-height: 1.08;
    letter-spacing: -0.045em;
}

.banner-content > p:not(.eyebrow) {
    max-width: 500px;
    margin-bottom: 0;
    color: #b9c8da;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.7;
}

.ranking-preview {
    width: 100%;
    max-width: 430px;
    margin-top: 35px;
    padding: 18px;
    border: 1px solid rgba(255, 255, 255, 0.11);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.055);
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(12px);
}

.preview-heading {
    padding: 1px 2px 12px;
}

.preview-heading small,
.preview-heading strong {
    display: block;
}

.preview-heading small {
    color: #96afca;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.13em;
}

.preview-heading strong {
    margin-top: 4px;
    color: var(--white);
    font-size: 14px;
    font-weight: 700;
}

.preview-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 11px 2px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    color: #cbd7e4;
    font-size: 13px;
    font-weight: 600;
}

.preview-row strong {
    min-width: 52px;
    padding: 5px 9px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 800;
    text-align: center;
}

.rank-up {
    color: #58dda2;
    background: rgba(50, 195, 132, 0.12);
}

.rank-down {
    color: #ff9494;
    background: rgba(255, 103, 103, 0.12);
}

.rank-same {
    color: #b8c5d4;
    background: rgba(184, 198, 215, 0.12);
}

.company-text {
    margin: 0;
    color: #7d92aa;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
}

/* ==========================================================================
   6. Auth card (right)
   ========================================================================== */

.login-form-section {
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding: 40px;
    background:
        radial-gradient(
            circle at 50% 50%,
            rgba(255, 255, 255, 0.9),
            transparent 52%
        ),
        var(--background);
}

.auth-card {
    width: min(420px, 100%);
    padding: 37px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--white);
    box-shadow: var(--shadow);
}

.auth-card .eyebrow {
    color: var(--blue);
}

.auth-card h1,
.auth-card h2 {
    margin: 7px 0 9px;
    color: var(--text);
    font-size: 28px;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.04em;
}

.description {
    margin-bottom: 25px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.6;
}

.auth-card label {
    display: block;
    margin-top: 18px;
    color: var(--text-soft);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.auth-card input,
.auth-card select {
    width: 100%;
    height: 48px;
    margin-top: 8px;
    padding: 0 14px;
    border: 1px solid #d5dfeb;
    border-radius: 10px;
    outline: none;
    color: var(--text);
    background: var(--white);
    font-size: 15px;
    font-weight: 600;
    transition:
        border-color 0.2s var(--ease),
        box-shadow 0.2s var(--ease);
}

.auth-card input::placeholder {
    color: #9ca8b8;
    font-weight: 500;
}

.auth-card input:hover,
.auth-card select:hover {
    border-color: #bdc9d8;
}

.auth-card input:focus,
.auth-card select:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 4px rgba(47, 111, 228, 0.13);
}

.auth-card input:disabled {
    background: #f1f5f9;
    color: var(--muted);
    cursor: not-allowed;
}

/* Password field */

.password-input {
    position: relative;
}

.password-input input {
    padding-right: 74px;
}

.password-input button {
    position: absolute;
    top: 8px;
    right: 6px;
    height: 48px;
    padding: 0 12px;
    border: 0;
    border-radius: 8px;
    color: var(--blue);
    background: transparent;
    font-size: 12px;
    font-weight: 800;
    transition: background 0.2s var(--ease), color 0.2s var(--ease);
}

.password-input button:hover {
    background: var(--blue-soft);
    color: var(--blue-dark);
}

/* Primary button */

.primary-button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: 50px;
    margin-top: 24px;
    padding: 0 18px;
    border: 0;
    border-radius: 10px;
    color: var(--white);
    background: linear-gradient(135deg, var(--blue), #2e70e9);
    box-shadow: 0 10px 24px rgba(47, 111, 228, 0.22);
    font-size: 15px;
    font-weight: 800;
    transition:
        transform 0.2s var(--ease),
        box-shadow 0.2s var(--ease),
        background 0.2s var(--ease);
}

.primary-button:hover:not(:disabled) {
    transform: translateY(-1px);
    background: linear-gradient(135deg, var(--blue-dark), #2865d6);
    box-shadow: 0 13px 28px rgba(47, 111, 228, 0.28);
}

.primary-button:active:not(:disabled) {
    transform: translateY(0);
}

.primary-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    box-shadow: none;
}

.primary-button span:last-child {
    font-size: 18px;
    font-weight: 500;
}

/* ==========================================================================
   7. Messages
   ========================================================================== */

.alert,
.setup-message {
    margin: 17px 0;
    padding: 12px 14px;
    border-radius: 9px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.5;
}

.alert.error {
    border: 1px solid #f4c5cb;
    color: #9e2e3b;
    background: var(--red-soft);
}

.alert.success {
    border: 1px solid #b8e5d5;
    color: #087553;
    background: var(--green-soft);
}

.setup-message {
    border: 1px solid #c3d9ff;
    color: #1c4ea6;
    background: var(--blue-soft);
}

.setup-message a {
    margin-left: 3px;
    color: var(--blue);
    font-weight: 800;
    text-decoration: underline;
}

.setup-message a:hover {
    color: var(--blue-dark);
}

.security-message {
    margin: 18px 0 0;
    color: #8a96a8;
    font-size: 11px;
    font-weight: 500;
    line-height: 1.5;
    text-align: center;
}

/* Create administrator page */

.auth-container {
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding: 35px 20px;
    background:
        radial-gradient(
            circle at 50% 30%,
            rgba(255, 255, 255, 0.95),
            transparent 52%
        ),
        var(--background);
}

.small-container {
    width: 100%;
}

.small-container .auth-card {
    margin: auto;
}

.auth-card .logo {
    margin-bottom: 28px;
}

/* ==========================================================================
   8. Responsive
   ========================================================================== */

@media (max-width: 950px) {
    .login-layout {
        grid-template-columns: 0.9fr 1.1fr;
    }

    .login-banner {
        padding: 35px;
    }

    .banner-content h1 {
        font-size: 39px;
    }
}

@media (max-width: 800px) {
    .login-layout {
        display: block;
    }

    .login-banner {
        min-height: auto;
        padding: 27px;
    }

    .login-banner .logo {
        margin-bottom: 38px;
    }

    .banner-content {
        margin: 0;
    }

    .banner-content h1 {
        max-width: 480px;
        font-size: 34px;
    }

    .banner-content > p:not(.eyebrow) {
        margin-bottom: 0;
    }

    .ranking-preview,
    .company-text {
        display: none;
    }

    .login-form-section {
        min-height: auto;
        padding: 30px 20px 45px;
    }

    .auth-card {
        padding: 30px;
    }
}

@media (max-width: 480px) {
    .login-banner {
        padding: 24px 20px;
    }

    .banner-content h1 {
        font-size: 30px;
    }

    .login-form-section {
        padding: 22px 14px 35px;
    }

    .auth-card {
        padding: 25px 21px;
        border-radius: 13px;
    }

    .auth-card h1,
    .auth-card h2 {
        font-size: 24px;
    }
}
