* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: radial-gradient(circle at 22% 22%, rgba(255, 255, 255, 0.05), transparent 34%),
                radial-gradient(circle at 78% 30%, rgba(0, 200, 170, 0.12), transparent 42%),
                linear-gradient(135deg, #081017 0%, #03060c 100%);
    color: #e5e7eb;
    position: relative;
}

a {
    color: #00c8aa;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.header {
    padding: 36px 40px 16px;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    text-align: left;
    gap: 16px;
}

.logo {
    width: 190px;
    max-width: 100%;
    height: auto;
}

.main-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 24px 24px;
}

.footer {
    padding: 16px 24px 32px;
    text-align: center;
    color: #9ca3af;
    font-size: 12px;
    line-height: 1.5;
}

.footer-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.footer-links span {
    color: #cbd5e1;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    background-image:
    linear-gradient(to right, rgba(0, 200, 170, 0.1) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0, 200, 170, 0.1) 1px, transparent 1px);
    background-size: 50px 50px;
    opacity: 0.85;
    pointer-events: none;
    z-index: 0;
    mask-image: linear-gradient( 150deg, transparent 0%, transparent 15%, black 33%, black 67%, transparent 85%, transparent 100% );
}

body > * {
    position: relative;
    z-index: 2;
}

.card,
.login-container,
.reset-container,
.grant-container {
    max-width: 555px;
    width: 100%;
    background: rgba(10, 13, 21, 0.85);
    border: 1px solid rgba(0, 200, 170, 0.25);
    border-radius: 12px;
    box-shadow: 0 22px 60px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(4px);
}

input::-ms-reveal,
input::-webkit-contacts-auto-fill-button,
input::-webkit-credentials-auto-fill-button,
input::-webkit-password-toggle--icon {
    filter: invert(100%);
}

.theme-card {
    padding: 32px 32px 28px;
}

.theme-card-header {
    margin-bottom: 24px;
}

.theme-card-footer {
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid rgba(148, 163, 184, 0.16);
}

.theme-card-footer-text {
    color: #94a3b8;
    font-size: 13px;
    text-align: center;
}

.locale-switcher {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #cbd5e1;
    font-size: 13px;
}

.locale-switcher-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.locale-switcher-links a[aria-current="true"] {
    color: #e5e7eb;
    text-decoration: underline;
}

.required-fields-note {
    color: #94a3b8;
    font-size: 13px;
    margin-bottom: 10px;
}

.required {
    color: #f97316;
}

#kc-page-title {
    color: #e5e7eb;
    font-size: 26px;
    font-weight: 600;
    line-height: 1.25;
}

#kc-content-wrapper,
#kc-form,
#kc-form-wrapper,
#kc-content,
#kc-registration,
#kc-info-wrapper {
    display: grid;
    gap: 18px;
}

#kc-content {
    width: 100%;
}

#kc-form form,
#kc-content form,
.theme-card form {
    display: grid;
    gap: 18px;
}

.no-bottom-margin {
    margin-bottom: 0;
}

.inline-link-row {
    display: flex;
    justify-content: center;
}

.user-context {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid rgba(0, 200, 170, 0.22);
    border-radius: 8px;
}

#kc-attempted-username {
    color: #e5e7eb;
    font-weight: 600;
}

.restart-link {
    font-size: 14px;
}

hr {
    border: 0;
    border-top: 1px solid rgba(148, 163, 184, 0.16);
    margin: 2px 0 8px;
}

.alert {
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.5;
}

.alert-info {
    background: rgba(59, 130, 246, 0.12);
    color: #bfdbfe;
    border: 1px solid rgba(59, 130, 246, 0.35);
}

.alert-error,
.alert-danger {
    background: rgba(220, 38, 38, 0.14);
    color: #fca5a5;
    border: 1px solid rgba(248, 113, 113, 0.45);
}

.alert a {
    color: inherit;
    text-decoration: underline;
}

.checkbox,
.checkbox label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #cbd5e1;
    font-size: 14px;
}

.checkbox input {
    margin: 0;
}

#kc-form-options,
.kcFormOptionsWrapperClass,
.kc-form-options-wrapper {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

#kc-social-providers {
    margin-top: 6px;
    padding-top: 6px;
}

#kc-social-providers h2,
#kc-social-providers h4 {
    color: #94a3b8;
    font-size: 13px;
    font-weight: 500;
    text-align: center;
    margin: 0 0 14px;
}

#kc-social-providers ul {
    list-style: none;
    display: grid;
    gap: 10px;
    padding: 0;
    margin: 0;
}

#kc-social-providers a,
#kc-social-providers button {
    width: 100%;
    padding: 12px 14px;
    background: #1f2937;
    color: #e5e7eb;
    border: 1px solid #374151;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

#kc-social-providers a:hover,
#kc-social-providers button:hover {
    background: #374151;
    border-color: #4b5563;
    text-decoration: none;
}

#kc-form-buttons input[type="submit"],
#kc-form-buttons button,
.theme-card input[type="submit"],
.theme-card button[type="submit"] {
    width: 100%;
    padding: 14px;
    background: #00c8aa;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.1s ease;
}

#kc-form-buttons input[type="submit"]:hover,
#kc-form-buttons button:hover,
.theme-card input[type="submit"]:hover,
.theme-card button[type="submit"]:hover {
    background: #00b399;
}

#kc-form-buttons input[type="submit"]:active,
#kc-form-buttons button:active,
.theme-card input[type="submit"]:active,
.theme-card button[type="submit"]:active {
    transform: translateY(1px);
}

.theme-card button[type="button"],
.theme-card .button-secondary,
.theme-card a.button-secondary {
    padding: 12px 16px;
    background: transparent;
    color: #cbd5e1;
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 8px;
}

.theme-card input[type="text"],
.theme-card input[type="password"],
.theme-card input[type="email"],
.theme-card input[type="number"],
.theme-card input[type="tel"],
.theme-card input[type="date"],
.theme-card input[type="time"],
.theme-card input[type="datetime-local"],
.theme-card textarea,
.theme-card select {
    width: 100%;
    padding: 12px 14px;
    background: #0f172a;
    border: 1px solid #1f2937;
    border-radius: 6px;
    color: #e5e7eb;
    font-size: 14px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.theme-card input:focus,
.theme-card textarea:focus,
.theme-card select:focus {
    outline: none;
    border-color: #00c8aa;
    box-shadow: 0 0 0 3px rgba(0, 200, 170, 0.2);
}

.theme-card label {
    display: block;
    color: #cbd5e1;
    font-size: 14px;
    margin-bottom: 8px;
}

.checkbox-group label {
    margin-bottom: 0px;
}

.theme-card .input-error,
.theme-card [id^="input-error"] {
    color: #fca5a5;
    font-size: 13px;
}

.text-stack {
    display: grid;
    gap: 12px;
}

.text-stack p,
.instruction-text,
.info-text,
.description,
.app-description,
.permission-text,
.theme-card p {
    color: #cbd5e1;
    font-size: 15px;
    line-height: 1.6;
}

.text-center {
    text-align: center;
}

.email-address {
    color: #00c8aa;
    font-weight: 500;
}

.action-stack {
    display: grid;
    gap: 12px;
}

.btn-primary,
.btn-secondary {
    width: 100%;
    min-height: 48px;
}

.btn-secondary {
    padding: 12px 16px;
    background: transparent;
    color: #cbd5e1;
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.btn-secondary:hover {
    border-color: rgba(226, 232, 240, 0.6);
    color: #e2e8f0;
    background: rgba(148, 163, 184, 0.08);
}

.btn-secondary-link,
.btn-tertiary-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 48px;
    padding: 12px 16px;
    border-radius: 8px;
    text-decoration: none;
    transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.btn-secondary-link {
    background: rgba(0, 200, 170, 0.15);
    color: #00c8aa;
    border: 1px solid rgba(0, 200, 170, 0.3);
}

.btn-secondary-link:hover {
    background: rgba(0, 200, 170, 0.25);
    border-color: rgba(0, 200, 170, 0.5);
    text-decoration: none;
}

.btn-tertiary-link {
    background: transparent;
    color: #cbd5e1;
    border: 1px solid rgba(148, 163, 184, 0.35);
}

.btn-tertiary-link:hover {
    color: #e5e7eb;
    border-color: rgba(226, 232, 240, 0.6);
    background: rgba(148, 163, 184, 0.08);
    text-decoration: none;
}

.provider-info,
.instructions,
.app-info {
    display: grid;
    gap: 8px;
    margin: 4px 0 8px;
    padding: 16px;
    background: rgba(0, 200, 170, 0.08);
    border: 1px solid rgba(0, 200, 170, 0.2);
    border-radius: 8px;
}

.provider-info-label {
    color: #94a3b8;
    font-size: 13px;
}

.provider-info-value,
.app-name {
    color: #00c8aa;
    font-size: 18px;
    font-weight: 600;
}

.resend-section {
    margin-top: 8px;
    padding-top: 18px;
    border-top: 1px solid rgba(148, 163, 184, 0.16);
}

.resend-text {
    color: #94a3b8;
    font-size: 14px;
    margin-bottom: 12px;
    text-align: center;
}

.btn-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 48px;
    padding: 12px 16px;
    background: rgba(0, 200, 170, 0.15);
    color: #00c8aa;
    border: 1px solid rgba(0, 200, 170, 0.3);
    border-radius: 8px;
    text-decoration: none;
}

.btn-link:hover {
    background: rgba(0, 200, 170, 0.25);
    border-color: rgba(0, 200, 170, 0.5);
    text-decoration: none;
}

.permissions-section {
    display: grid;
    gap: 12px;
}

.permissions-title,
.group-title {
    color: #e5e7eb;
    font-size: 16px;
    font-weight: 600;
}

.permissions-list,
.steps,
.supported-apps,
.policy-details {
    display: grid;
    gap: 10px;
}

.permissions-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.permission-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    background: #0f172a;
    border: 1px solid #1f2937;
    border-radius: 8px;
}

.permission-icon {
    color: #00c8aa;
    font-size: 20px;
    font-weight: 700;
    line-height: 1;
}

.buttons-container {
    display: grid;
    gap: 12px;
}

.info {
    display: grid;
    gap: 18px;
}

.steps {
    list-style: decimal inside;
    color: #cbd5e1;
}

.supported-apps,
.policy-details {
    padding-left: 18px;
    color: #94a3b8;
}

.supported-apps li {
    list-style: disc;
}

.policy-details li {
    list-style: disc;
}

.qr-wrapper {
    text-align: center;
}

.qr-wrapper img {
    width: min(250px, 100%);
    height: auto;
    border-radius: 8px;
    border: 1px solid rgba(148, 163, 184, 0.3);
}

.register-link-block {
    margin-top: 6px;
    text-align: center;
}

#kc-info-wrapper,
#kc-registration {
    color: #cbd5e1;
    font-size: 14px;
    text-align: center;
}

#kc-info-wrapper p,
#kc-registration p {
    margin: 0;
}

#kc-logout-confirm {
    display: grid;
    gap: 20px;
}

.logout-confirm-panel {
    display: grid;
    gap: 10px;
    padding: 18px 18px 16px;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.92), rgba(8, 16, 23, 0.8));
    border: 1px solid rgba(0, 200, 170, 0.2);
    border-radius: 12px;
}

.logout-confirm-eyebrow {
    color: #00c8aa;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.logout-confirm-message {
    color: #e5e7eb;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.45;
}

.logout-confirm-note {
    color: #94a3b8;
    font-size: 14px;
    line-height: 1.6;
}

.logout-confirm-actions {
    display: grid;
    gap: 16px;
}

.logout-confirm-buttons {
    display: grid;
    gap: 12px;
}

.logout-confirm-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 48px;
    padding: 12px 16px;
    color: #cbd5e1;
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 8px;
    text-decoration: none;
    transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.logout-confirm-back:hover {
    color: #e5e7eb;
    border-color: rgba(226, 232, 240, 0.6);
    background: rgba(148, 163, 184, 0.08);
    text-decoration: none;
}

.form-grid {
    display: grid;
    gap: 16px;
}

.group-header {
    margin-top: 8px;
}

.group-description,
.helper-text {
    color: #94a3b8;
    font-size: 13px;
}

#kc-select-credential-form button,
#kc-select-credential-form .kcSelectAuthListItemClass {
    text-align: left;
}

@media (max-width: 640px) {
    .header {
        padding: 28px 20px 12px;
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .locale-switcher {
        margin-left: 0;
        align-items: flex-start;
        flex-direction: column;
        gap: 6px;
    }

    .theme-card {
        padding: 24px 20px 22px;
    }

    #kc-page-title {
        font-size: 24px;
    }
}
