html {
    -webkit-text-size-adjust: 100%
}

/* ── Buttons ─────────────────────────────────────────── */

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 44px;
    padding: 0 1.5rem;
    font-size: .875rem;
    font-weight: 600;
    letter-spacing: .025em;
    color: #fff;
    background-color: rgb(18 31 46);
    border: none;
    border-radius: .5rem;
    cursor: pointer;
    transition: background-color .2s, box-shadow .2s, transform .1s;
    white-space: nowrap;
    line-height: 1
}

.btn-primary:hover {
    background-color: rgb(30 48 70)
}

.btn-primary:active {
    transform: scale(.98)
}

.btn-primary:focus-visible {
    outline: 2px solid rgb(59 130 246);
    outline-offset: 2px
}

.btn-primary:disabled {
    opacity: .65;
    cursor: not-allowed;
    pointer-events: none
}

.btn-spinner {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    margin-right: .5rem;
    border: 2px solid rgba(255,255,255,.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .6s linear infinite
}

@keyframes spin {
    to { transform: rotate(360deg) }
}

.btn-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .75rem;
    height: 44px;
    padding: 0 1rem;
    font-size: .875rem;
    font-weight: 600;
    color: rgb(55 65 81);
    background-color: #fff;
    border: 1px solid rgb(209 213 219);
    border-radius: .5rem;
    cursor: pointer;
    text-decoration: none;
    transition: background-color .2s, border-color .2s, box-shadow .2s;
    white-space: nowrap;
    line-height: 1
}

.btn-outline:hover {
    background-color: rgb(249 250 251);
    border-color: rgb(156 163 175)
}

.btn-outline:active {
    background-color: rgb(243 244 246)
}

.btn-outline:focus-visible {
    outline: 2px solid rgb(59 130 246);
    outline-offset: 2px
}

/* Full-width variant */
.btn-block {
    width: 100%
}

/* ── Inputs ──────────────────────────────────────────── */

.input-field {
    display: block;
    width: 100%;
    height: 44px;
    padding: .625rem 1rem .625rem 2.75rem;
    font-size: .875rem;
    line-height: 1.25rem;
    color: rgb(17 24 39);
    background-color: rgb(249 250 251);
    border: 1px solid rgb(229 231 235);
    border-radius: .5rem;
    outline: none;
    transition: border-color .2s, box-shadow .2s
}

.input-field::placeholder {
    color: rgb(156 163 175)
}

.input-field:focus {
    border-color: rgb(59 130 246);
    box-shadow: 0 0 0 3px rgb(59 130 246 / .1)
}

.input-field.input-error,
.input-field:invalid:not(:placeholder-shown) {
    border-color: rgb(239 68 68);
    box-shadow: 0 0 0 3px rgb(239 68 68 / .1)
}

/* ── Page headings ───────────────────────────────────── */

.page-heading {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 2.25rem;
    color: rgb(17 24 39);
    text-align: center;
    margin-bottom: .5rem
}

.page-subheading {
    font-size: .875rem;
    color: rgb(107 114 128);
    text-align: center;
    margin-bottom: 2rem
}

/* ── Divider ─────────────────────────────────────────── */

.divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem 0;
    color: rgb(156 163 175);
    font-size: .8125rem
}

.divider::before,
.divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background-color: rgb(229 231 235)
}

/* ── Status cards ────────────────────────────────────── */

.status-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .75rem;
    padding: 1.5rem 1rem;
    text-align: center;
    font-size: .875rem;
    line-height: 1.6;
    color: rgb(55 65 81)
}

.status-card .status-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    margin-bottom: .25rem
}

.status-card .status-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: rgb(17 24 39);
    margin: 0
}

.status-card .status-text {
    color: rgb(107 114 128);
    margin: 0;
    max-width: 320px
}

.status-card-success .status-icon {
    background-color: rgb(220 252 231);
    color: rgb(22 163 74)
}

.status-card-error .status-icon {
    background-color: rgb(254 226 226);
    color: rgb(220 38 38)
}

.status-card-info .status-icon {
    background-color: rgb(219 234 254);
    color: rgb(37 99 235)
}

/* ── Validation / errors ─────────────────────────────── */

.validation-errors {
    padding: .75rem 1rem;
    margin-bottom: 1rem;
    font-size: .8125rem;
    font-weight: 500;
    color: rgb(153 27 27);
    background-color: rgb(254 242 242);
    border: 1px solid rgb(254 202 202);
    border-radius: .5rem
}

.validation-errors ul {
    margin: 0;
    padding-left: 1.25rem;
    list-style: disc
}

/* ── Form spacing ────────────────────────────────────── */

.form-group {
    margin-bottom: 1rem
}

.form-group:last-of-type {
    margin-bottom: 0
}

.form-actions {
    display: flex;
    flex-direction: column;
    gap: .75rem;
    margin-top: 1.5rem
}

@media (min-width: 640px) {
    .form-actions-row {
        flex-direction: row;
        justify-content: space-between
    }
}

/* ── Links ───────────────────────────────────────────── */

.link {
    font-size: .875rem;
    font-weight: 500;
    color: rgb(107 114 128);
    text-decoration: none;
    transition: color .2s
}

.link:hover {
    color: rgb(59 130 246);
    text-decoration: underline
}

.link-back {
    display: inline-flex;
    align-items: center;
    gap: .375rem;
    margin-top: 1.5rem
}

.link-back::before {
    content: "\2190"
}

/* ── Input group (icon + input) ──────────────────────── */

.input-group {
    position: relative
}

.input-icon {
    position: absolute;
    top: 50%;
    left: .875rem;
    transform: translateY(-50%);
    color: rgb(156 163 175);
    pointer-events: none;
    display: flex
}

.input-icon svg {
    width: 1rem;
    height: 1rem
}

/* ── Card / layout refinements ───────────────────────── */

.auth-card {
    border-radius: .75rem;
    overflow: hidden
}

.auth-card-content {
    padding-top: 3rem;
    padding-bottom: 3rem
}

@media (min-width: 1024px) {
    .auth-card-content {
        padding-top: 2rem;
        padding-bottom: 2rem
    }
}

.auth-card-image {
    object-fit: cover
}

/* ── Mobile logo (visible below lg breakpoint) ──────── */

.mobile-logo {
    justify-content: center;
    margin-bottom: 1.5rem
}

.mobile-logo-img {
    height: 60px;
    width: auto
}

/* ── Logout page ─────────────────────────────────────── */

.logout-page {
    text-align: center
}

.logout-page h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: rgb(17 24 39);
    margin-bottom: .5rem
}

.logout-page p {
    font-size: .875rem;
    color: rgb(107 114 128);
    margin-bottom: 1.5rem
}

/* ── Misc ────────────────────────────────────────────── */

.text-balance {
    text-wrap: balance
}

.forgot-link {
    display: block;
    text-align: right;
    font-size: .8125rem;
    font-weight: 500;
    color: rgb(107 114 128);
    text-decoration: none;
    transition: color .2s;
    margin-top: .25rem;
    margin-bottom: 1.5rem
}

.forgot-link:hover {
    color: rgb(59 130 246)
}

/* ── Password validation errors ─────────────────────── */

.pw-error {
    font-size: .75rem;
    color: rgb(239 68 68);
    margin-top: .25rem;
    min-height: 1.125rem
}

.pw-error:empty {
    margin: 0;
    min-height: 0
}

/* ── Language picker ────────────────────────────────── */

.lang-picker {
    position: relative;
    display: flex;
    justify-content: flex-end;
    margin-top: 1.5rem
}

.lang-picker-btn {
    display: inline-flex;
    align-items: center;
    gap: .375rem;
    padding: .375rem .625rem;
    font-size: .75rem;
    font-weight: 500;
    color: rgb(107 114 128);
    background: none;
    border: 1px solid rgb(229 231 235);
    border-radius: .375rem;
    cursor: pointer;
    transition: border-color .2s, color .2s;
    line-height: 1
}

.lang-picker-btn:hover {
    border-color: rgb(156 163 175);
    color: rgb(55 65 81)
}

.lang-picker-btn svg {
    flex-shrink: 0
}

.lang-picker-chevron {
    transition: transform .2s
}

.lang-picker-btn[aria-expanded="true"] .lang-picker-chevron {
    transform: rotate(180deg)
}

.lang-picker-menu {
    display: none;
    position: absolute;
    bottom: 100%;
    right: 0;
    margin-bottom: .25rem;
    min-width: 140px;
    padding: .25rem 0;
    background: #fff;
    border: 1px solid rgb(229 231 235);
    border-radius: .5rem;
    box-shadow: 0 4px 12px rgb(0 0 0 / .08);
    list-style: none;
    z-index: 50
}

.lang-picker-menu.open {
    display: block
}

.lang-picker-item {
    display: block;
    width: 100%;
    padding: .5rem .75rem;
    font-size: .8125rem;
    color: rgb(55 65 81);
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    transition: background-color .15s
}

.lang-picker-item:hover {
    background-color: rgb(243 244 246)
}

.lang-picker-item.active {
    font-weight: 600;
    color: rgb(17 24 39)
}
