/* Auth shell — login, 2FA, forgot/reset
   Placement mirrors the AuthFlow reference; buttons use brand green. */

/* AdminLTE sets html/body { height: 100% }, which leaves a white strip
   once the auth card grows past the viewport (e.g. method list open). */
html.auth-html {
    height: auto !important;
    min-height: 100%;
    background: #f4f7f6;
}

.auth-page {
    --auth-green: #65a97a;
    --auth-green-hover: #528c64;
    --auth-ink: #0f172a;
    --auth-muted: #64748b;
    --auth-label: #64748b;
    --auth-border: #e2e8f0;
    --auth-field-bg: rgba(248, 250, 252, 0.7);
    --auth-card-bg: rgba(255, 255, 255, 0.88);
    --auth-bg: #f4f7f6;
    --auth-navy-soft: rgba(35, 49, 66, 0.1);

    height: auto !important;
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    display: flex;
    align-items: safe center;
    justify-content: center;
    position: relative;
    overflow-x: hidden;
    overflow-y: auto;
    box-sizing: border-box;
    padding: 32px 0;
    background-color: var(--auth-bg) !important;
    background-image: radial-gradient(ellipse at 50% 0%, #ffffff 0%, var(--auth-bg) 70%) !important;
    background-attachment: fixed;
    background-repeat: no-repeat;
    background-size: cover;
    font-family: "Source Sans Pro", "Helvetica Neue", Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

.auth-page.hold-transition.login-page {
    height: auto !important;
    background-color: var(--auth-bg) !important;
    background-image: radial-gradient(ellipse at 50% 0%, #ffffff 0%, var(--auth-bg) 70%) !important;
}

.auth-blob {
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    filter: blur(100px);
    z-index: 0;
}

.auth-blob--green {
    top: -10%;
    left: -10%;
    width: 40%;
    min-width: 280px;
    height: 40%;
    min-height: 280px;
    background: rgba(101, 169, 122, 0.15);
    animation: auth-float 20s infinite ease-in-out;
}

.auth-blob--navy {
    bottom: -10%;
    right: -10%;
    width: 40%;
    min-width: 280px;
    height: 40%;
    min-height: 280px;
    background: var(--auth-navy-soft);
    animation: auth-float 20s infinite ease-in-out;
    animation-delay: 2s;
}

@keyframes auth-float {
    0% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -50px) scale(1.1); }
    66% { transform: translate(-20px, 20px) scale(0.9); }
    100% { transform: translate(0, 0) scale(1); }
}

.auth-shell {
    width: 100%;
    max-width: 440px;
    padding: 24px 20px 32px;
    position: relative;
    z-index: 1;
}

.auth-logo {
    text-align: center;
    margin-bottom: 28px;
}

.auth-logo a {
    display: inline-block;
}

.auth-logo img {
    max-width: 280px;
    width: 100%;
    height: auto;
    margin: 0 !important;
}

.auth-card {
    background: var(--auth-card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 2.5rem;
    border: 1px solid #fff;
    box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.12);
    padding: 36px 32px 32px;
    position: relative;
    overflow: hidden;
}

@media (min-width: 480px) {
    .auth-card {
        padding: 40px 40px 36px;
    }
}

.auth-card__back {
    position: absolute;
    top: 20px;
    left: 20px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    border-radius: 50%;
    text-decoration: none;
    transition: color 0.15s ease, background 0.15s ease;
}

.auth-card__back:hover,
.auth-card__back:focus {
    color: #334155;
    background: #f1f5f9;
    text-decoration: none;
}

.auth-card__icon {
    width: 64px;
    height: 64px;
    margin: 8px auto 16px;
    border-radius: 50%;
    background: rgba(101, 169, 122, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--auth-green);
    font-size: 28px;
}

.auth-card__header {
    text-align: center;
    margin-bottom: 28px;
}

.auth-card__title {
    margin: 0;
    font-size: 1.875rem;
    font-weight: 800;
    color: var(--auth-ink);
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.auth-card__subtitle {
    margin: 10px 0 0;
    font-size: 1.0625rem;
    font-weight: 500;
    color: var(--auth-muted);
    line-height: 1.45;
}

.auth-card__subtitle strong,
.auth-card__subtitle .auth-emphasis {
    font-weight: 700;
    color: #334155;
}

.auth-label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    color: var(--auth-label);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: 0 0 8px 4px;
}

.auth-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    gap: 8px;
}

.auth-label-row .auth-label {
    margin: 0 0 0 4px;
}

.auth-link {
    font-size: 11px;
    font-weight: 700;
    color: var(--auth-green);
    text-decoration: none;
}

.auth-link:hover,
.auth-link:focus {
    color: var(--auth-green-hover);
    text-decoration: none;
}

.auth-field {
    margin-bottom: 18px;
}

.auth-field.has-error .auth-input,
.auth-field.has-error .form-control {
    border-color: #c84a56;
}

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

.auth-input-wrap > .fa,
.auth-input-wrap > .glyphicon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 16px;
    pointer-events: none;
    z-index: 2;
    transition: color 0.15s ease;
}

.auth-input-wrap:focus-within > .fa,
.auth-input-wrap:focus-within > .glyphicon {
    color: var(--auth-green);
}

.auth-page .auth-input-wrap .form-control,
.auth-page .auth-input {
    display: block;
    width: 100%;
    height: auto;
    padding: 14px 16px 14px 48px;
    font-size: 14px;
    font-weight: 700;
    color: #1e293b;
    background: var(--auth-field-bg);
    border: 1px solid var(--auth-border);
    border-radius: 1rem;
    box-shadow: none;
    transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.auth-page .auth-input-wrap .form-control:hover {
    border-color: #cbd5e1;
}

.auth-page .auth-input-wrap .form-control:focus,
.auth-page .auth-input:focus {
    background: #fff;
    border-color: var(--auth-green);
    outline: none;
    box-shadow: 0 0 0 4px rgba(101, 169, 122, 0.12);
}

.auth-page .auth-input-wrap .form-control::placeholder {
    color: #94a3b8;
    font-weight: 500;
}

/* Kill AdminLTE glyphicon feedback absolute positioning inside auth fields */
.auth-page .auth-input-wrap .form-control-feedback {
    display: none;
}

.auth-page .help-block,
.auth-page .text-danger,
.auth-page .field-validation-error {
    display: block;
    margin-top: 6px;
    margin-bottom: 0;
    font-size: 12px;
    font-weight: 600;
    color: #c84a56;
}

.auth-alert {
    border-radius: 1rem;
    padding: 12px 14px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 16px;
    border: none;
}

.auth-alert.alert-info {
    background: rgba(101, 169, 122, 0.12);
    color: #2f6b45;
}

.auth-alert.alert-danger {
    background: #fdecee;
    color: #c84a56;
}

.auth-error {
    margin-bottom: 16px;
    text-align: center;
}

.auth-error .help-block {
    margin: 0;
}

/* Primary CTA — brand green, full width */
.auth-page .auth-btn-primary,
.auth-page button.auth-btn-primary,
.auth-page .btn.auth-btn-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin-top: 8px;
    padding: 14px 24px;
    font-size: 14px;
    font-weight: 700;
    color: #fff !important;
    background: var(--auth-green) !important;
    border: 1px solid var(--auth-green) !important;
    border-radius: 1rem;
    box-shadow: none;
    transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.auth-page .auth-btn-primary:hover,
.auth-page .auth-btn-primary:focus,
.auth-page .auth-btn-primary:active,
.auth-page .btn.auth-btn-primary:hover,
.auth-page .btn.auth-btn-primary:focus,
.auth-page .btn.auth-btn-primary:active {
    color: #fff !important;
    background: var(--auth-green-hover) !important;
    border-color: var(--auth-green-hover) !important;
    box-shadow: 0 10px 24px rgba(101, 169, 122, 0.28);
    transform: translateY(-1px);
}

.auth-page .auth-btn-primary:disabled,
.auth-page .auth-btn-primary.disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.auth-btn-primary .fa {
    margin-left: 8px;
    font-size: 13px;
}

.auth-page .auth-btn-secondary,
.auth-page .btn.auth-btn-secondary {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin-top: 10px;
    padding: 12px 20px;
    font-size: 13px;
    font-weight: 700;
    color: #475569 !important;
    background: #f8fafc !important;
    border: 1px solid var(--auth-border) !important;
    border-radius: 1rem;
    box-shadow: none;
}

.auth-page .auth-btn-secondary:hover,
.auth-page .auth-btn-secondary:focus {
    background: #f1f5f9 !important;
    color: #1e293b !important;
    border-color: #cbd5e1 !important;
}

.auth-page .auth-btn-secondary .fa,
.auth-page .auth-btn-secondary .glyphicon {
    margin-right: 8px;
}

/* 2FA OTP */
.auth-page .verification-code {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 0 0 20px;
    flex-wrap: nowrap;
}

.auth-page .code-input {
    width: 44px;
    height: 56px;
    font-size: 22px;
    font-weight: 800;
    text-align: center;
    color: #1e293b;
    background: var(--auth-field-bg);
    border: 1px solid var(--auth-border);
    border-radius: 1rem;
    box-shadow: none;
    transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

@media (min-width: 400px) {
    .auth-page .code-input {
        width: 52px;
        height: 60px;
        font-size: 24px;
    }
}

.auth-page .code-input:focus {
    background: #fff;
    border-color: var(--auth-green);
    outline: none;
    box-shadow: 0 0 0 4px rgba(101, 169, 122, 0.12);
}

.auth-footer-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid #f1f5f9;
}

.auth-text-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0;
    border: none;
    background: none;
    font-size: 14px;
    font-weight: 700;
    color: var(--auth-muted);
    cursor: pointer;
    text-decoration: none;
}

.auth-text-btn:hover,
.auth-text-btn:focus {
    color: var(--auth-green);
    text-decoration: none;
}

.auth-text-btn--muted {
    font-size: 11px;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.auth-text-btn--muted:hover,
.auth-text-btn--muted:focus {
    color: #64748b;
}

.auth-method-list {
    width: 100%;
    margin-top: 8px;
}

.auth-method-list .auth-btn-secondary {
    margin-top: 8px;
}

.auth-method-hint {
    text-align: center;
    font-size: 13px;
    font-weight: 500;
    color: var(--auth-muted);
    margin: 0 0 8px;
}

.auth-footer {
    text-align: center;
    margin-top: 28px;
}

.auth-footer p {
    margin: 0;
    font-size: 12px;
    font-weight: 500;
    color: #94a3b8;
}

.auth-footer .auth-version {
    display: block;
    margin-top: 4px;
    font-size: 10px;
    color: #cbd5e1;
}

.auth-page a {
    color: var(--auth-green);
}

.auth-page a:hover {
    color: var(--auth-green-hover);
}

/* Override AdminLTE login-page body defaults when shell is present */
body.auth-page.login-page {
    height: auto !important;
    min-height: 100vh;
    min-height: 100dvh;
}
