/*
 * TierPult Login
 *
 * Native Frappe login structure and authentication remain unchanged.
 * Styling is strictly scoped to the login route.
 */

body[data-path="login"] {
    --tp-login-green: #4cb94d;
    --tp-login-turquoise: #008b78;
    --tp-login-violet: #7737b5;
    --tp-login-violet-deep: #6e2ba5;
    --tp-login-ink: #1f2937;
    --tp-login-canvas: #f3f4f6;
    --tp-login-surface: #ffffff;
    --tp-login-border: #d8dee7;
    --tp-login-focus: #7737b5;
    --tp-login-primary-soft: #f1e9f8;

    min-height: 100vh;
    color: var(--tp-login-ink);
    background:
        radial-gradient(
            circle at 14% 12%,
            rgb(76 185 77 / 10%),
            transparent 34rem
        ),
        radial-gradient(
            circle at 88% 82%,
            rgb(119 55 181 / 10%),
            transparent 38rem
        ),
        var(--tp-login-canvas);
}

body[data-path="login"] .page-content-wrapper {
    min-height: 100vh;
}

body[data-path="login"] .page_content {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 2rem 1rem;
}

body[data-path="login"] .for-login,
body[data-path="login"] .for-email-login,
body[data-path="login"] .for-signup,
body[data-path="login"] .for-forgot,
body[data-path="login"] .for-login-with-email-link {
    width: min(100%, 28rem);
}

body[data-path="login"] .login-content.page-card {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 2rem;
    border: 1px solid var(--tp-login-border);
    border-radius: 1rem;
    background: var(--tp-login-surface);
    box-shadow:
        0 1px 2px rgb(31 41 55 / 5%),
        0 18px 48px rgb(31 41 55 / 10%);
}

body[data-path="login"] .page-card-head {
    margin-bottom: 1.75rem;
}

body[data-path="login"] .page-card-head .app-logo {
    width: auto;
    max-width: min(100%, 15rem);
    height: 3.75rem;
    margin-bottom: 1.25rem;
    object-fit: contain;
}

body[data-path="login"] .page-card-head h4 {
    color: var(--tp-login-ink);
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

body[data-path="login"] .page-card-subtitle {
    color: #5f6b7a;
    line-height: 1.5;
}

body[data-path="login"] .form-label {
    color: var(--tp-login-ink);
    font-weight: 600;
}

body[data-path="login"] .form-control {
    min-height: 2.75rem;
    border-color: var(--tp-login-border);
    border-radius: 0.5rem;
}

body[data-path="login"] .form-control:focus {
    border-color: var(--tp-login-focus);
    box-shadow:
        0 0 0 3px var(--tp-login-primary-soft);
}

body[data-path="login"] .btn {
    min-height: 2.75rem;
    border-radius: 0.5rem;
    font-weight: 650;
}

body[data-path="login"] .btn-primary,
body[data-path="login"] .btn-login {
    border-color: var(--tp-login-violet-deep);
    background: var(--tp-login-violet-deep);
    color: #ffffff;
}

body[data-path="login"] .btn-primary:hover,
body[data-path="login"] .btn-login:hover {
    border-color: #5f238f;
    background: #5f238f;
    color: #ffffff;
}

body[data-path="login"] a {
    color: var(--tp-login-violet-deep);
}

body[data-path="login"] a:hover {
    color: #5f238f;
}

body[data-path="login"]
    :where(a, button, input):focus-visible {
    outline: 3px solid var(--tp-login-focus);
    outline-offset: 2px;
}

@media (max-width: 575.98px) {
    body[data-path="login"] .page_content {
        padding: 1rem;
    }

    body[data-path="login"] .login-content.page-card {
        padding: 1.5rem;
        border-radius: 0.75rem;
    }

    body[data-path="login"] .page-card-head .app-logo {
        height: 3rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    body[data-path="login"] *,
    body[data-path="login"] *::before,
    body[data-path="login"] *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

@media (forced-colors: active) {
    body[data-path="login"] .login-content.page-card,
    body[data-path="login"] .form-control {
        border-color: CanvasText;
    }

    body[data-path="login"]
        :where(a, button, input):focus-visible {
        outline-color: Highlight;
    }
}
