html, body.authapp-body {
    height: 100%;
    margin: 0;
    font-family: 'Open Sans', Arial, sans-serif;
    display: flex;
    flex-direction: column;
    color: #ffffff;
}

body.authapp-body {
    position: relative;
    background: radial-gradient(circle at 20% 20%, rgba(52, 61, 102, 0.35), transparent 25%),
                radial-gradient(circle at 80% 0%, rgba(255, 255, 255, 0.05), transparent 20%),
                linear-gradient(135deg, #0f1529 0%, #0b1b35 50%, #0f1529 100%);
    background-attachment: fixed;
    overflow-x: hidden;
}

body.authapp-body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(20, 26, 46, 0.65);
    z-index: 0;
}

.authapp-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
    position: relative;
    z-index: 1;
}

.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    max-width: 370px;
    min-width: 320px;
    width: 100%;
}

.login-box {
    width: 100%;
    max-width: 360px;
    margin: auto;
    padding: 32px 28px;
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
    background-color: #0b1b35;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.login-logo {
    margin-bottom: 12px;
}

.login-logo img {
    width: 180px;
    max-width: 70%;
}

/* Text wordmark for brands without a logo image, e.g. DT Control (matches the v2 home .home-brand) */
.login-wordmark {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #ffffff;
}

.login-wordmark span {
    color: #2AE3FF;
}

.login-box h2 {
    color: white;
    margin-bottom: 10px;
    font-size: 24px;
}

.login-box p {
    color: #d9e1ec;
    margin-bottom: 10px;
    font-size: 15px;
}

.form-group {
    margin-bottom: 14px;
}

.form-input {
    width: 100%;
    margin: 0 auto;
    padding: 12px;
    border: 1px solid #2b3357;
    border-radius: 10px;
    background-color: #1d233d;
    color: white;
    font-size: 16px;
    box-sizing: border-box;
}

.form-input:focus {
    outline: 2px solid #4b9cff;
}

.form-input::placeholder {
    color: #9aa3b5;
}

.login-button {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 10px;
    background-color: #ffffff;
    color: #0b1b35;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.login-button:hover {
    background-color: #dce3ff;
}

.login-button:active {
    transform: translateY(1px);
}

.alert {
    margin: 10px auto 14px auto;
    font-size: 14px;
    color: #721c24;
    background-color: #f8d7da;
    padding: 10px;
    border-radius: 10px;
    text-align: center;
    border: 1px solid #f5c6cb;
}

.alert-danger {
    color: #721c24;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
}

.alert-success {
    color: #155724;
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
}

.support-text {
    margin-top: 14px;
    color: #d9e1ec;
    font-size: 13px;
}

.support-text a {
    color: #b9d4ff;
}

@media (max-width: 600px) {
    .authapp-shell {
        padding: 24px 12px;
    }

    .login-box {
        padding: 24px 20px;
    }
}

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

.authapp-privacy {
    position: fixed;
    left: 0;
    right: 0;
    bottom: max(12px, env(safe-area-inset-bottom, 0px));
    margin: 0;
    text-align: center;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    z-index: 1;
}

.authapp-powered {
    margin-right: 10px;
    padding-right: 10px;
    border-right: 1px solid currentColor;
}

.login-actions {
    display: grid;
    gap: 10px;
    margin: 18px 0 4px;
}

.login-actions form {
    margin: 0;
}

a.login-button {
    display: block;
    box-sizing: border-box;
    text-decoration: none;
}

.login-button-secondary {
    background-color: transparent;
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.45);
}

.login-button-secondary:hover {
    background-color: rgba(255, 255, 255, 0.08);
}

/* ---- An organisation's own site ---- */
body.authapp-site { background: var(--ground, #050A16); }
body.authapp-site::after { display: none; }
.authapp-site .login-box { background-color: var(--card, #0C1324); border-color: rgba(255, 255, 255, 0.08); }
.authapp-site .login-logo img { width: auto; max-width: 70%; max-height: 72px; }
.authapp-site .form-input { background-color: rgba(255, 255, 255, 0.06); border-color: rgba(255, 255, 255, 0.14); }
.authapp-site .form-input:focus { outline-color: var(--accent, #2AE3FF); }
.authapp-site .login-button { background-color: var(--accent, #2AE3FF); color: var(--on-accent, #00081D); }
.authapp-site .login-button:hover { background-color: var(--accent, #2AE3FF); filter: brightness(1.08); }
.authapp-site .support-text a { color: var(--accent, #2AE3FF); }
