/*
 * Login page (resources/views/@auth/login/show.blade.php).
 * Colours come from the client's settings (--primary-theme-color, set by the auth layout) with a
 * fallback. Logical properties (inline-start/end) keep RTL and LTR correct.
 */
.auth-shell {
    --auth-primary: var(--primary-theme-color, #1e88e5);
    --auth-text: #1f2937;
    --auth-muted: #6b7280;
    --auth-border: #d9dee7;
    --auth-surface: #ffffff;
    --auth-page: #f4f6fa;
    --auth-danger: #c62828;
    --auth-radius: 10px;

    display: flex;
    min-height: 100vh;
    background: var(--auth-page);
    color: var(--auth-text);
}

/* ---------------------------------------------------------------- form side */

.auth-panel {
    position: relative;
    flex: 1 1 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 72px 24px 32px;
}

.auth-langs {
    position: absolute;
    top: 20px;
    inset-inline-end: 24px;
    display: flex;
    gap: 2px;
    padding: 3px;
    border: 1px solid var(--auth-border);
    border-radius: 999px;
    background: var(--auth-surface);
}

.auth-langs__item {
    padding: 4px 14px;
    border-radius: 999px;
    font-size: 13px;
    color: var(--auth-muted);
    text-decoration: none;
}

.auth-langs__item:hover {
    color: var(--auth-text);
    text-decoration: none;
}

.auth-langs__item--active {
    background: var(--auth-primary);
    color: #fff;
}

.auth-card {
    width: 100%;
    max-width: 500px;
    padding: 48px 44px;
    border: 1px solid var(--auth-border);
    border-radius: 16px;
    background: var(--auth-surface);
    box-shadow: 0 12px 32px rgba(17, 24, 39, 0.08);
}

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

.auth-card__logo {
    max-width: 220px;
    max-height: 80px;
    margin-bottom: 20px;
    object-fit: contain;
}

.auth-card__title {
    margin: 0 0 8px;
    font-size: 28px;
    font-weight: 700;
    color: var(--auth-text);
}

.auth-card__subtitle {
    margin: 0;
    font-size: 15px;
    color: var(--auth-muted);
}

.auth-alert {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    margin-bottom: 20px;
    font-size: 14px;
}

/* ---------------------------------------------------------------- password form */

.auth-form__title {
    margin: 0 0 16px;
    font-weight: 600;
    text-align: center;
}

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

.auth-field__label {
    display: block;
    margin-bottom: 8px;
    font-size: 15px;
    font-weight: 600;
    color: var(--auth-text);
}

.auth-field__control {
    position: relative;
}

.auth-field__icon {
    position: absolute;
    top: 50%;
    inset-inline-start: 14px;
    transform: translateY(-50%);
    color: var(--auth-muted);
    pointer-events: none;
}

/*
 * The inputs are dir="ltr" (email / password), so their logical padding would follow LTR while the
 * icon follows the page direction. Use physical sides per page direction instead.
 */
.auth-field__input.form-control {
    height: 52px;
    padding-left: 42px;
    padding-right: 14px;
    border: 1px solid var(--auth-border);
    border-radius: var(--auth-radius);
    background: #fff;
    color: var(--auth-text);
    font-size: 15px;
    box-shadow: none;
}

/* Email / username / password are always left-to-right; keep the placeholder on the reading side. */
[dir="rtl"] .auth-field__input.form-control::placeholder {
    text-align: right;
}

.auth-field__input--with-action.form-control {
    padding-right: 46px;
}

[dir="rtl"] .auth-field__input.form-control {
    padding-right: 42px;
    padding-left: 14px;
}

[dir="rtl"] .auth-field__input--with-action.form-control {
    padding-left: 46px;
}

.auth-field__input.form-control:focus {
    border-color: var(--auth-primary);
    box-shadow: 0 0 0 3px rgba(30, 136, 229, 0.18);
    outline: none;
}

.auth-field__input.form-control.is-invalid {
    border-color: var(--auth-danger);
    background-image: none;
}

.auth-field__action {
    position: absolute;
    top: 50%;
    inset-inline-end: 6px;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--auth-muted);
}

.auth-field__action:hover {
    color: var(--auth-text);
}

.auth-field__error {
    margin-top: 6px;
    font-size: 13px;
    color: var(--auth-danger);
}

/* ---------------------------------------------------------------- buttons */

.auth-submit,
.auth-method-btn {
    position: relative;
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 52px;
    padding: 10px 16px;
    border-radius: var(--auth-radius);
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    transition: background-color 0.15s ease, border-color 0.15s ease, filter 0.15s ease;
}

.auth-submit {
    margin-top: 8px;
    border: 1px solid var(--auth-primary);
    background: var(--auth-primary);
    color: #fff;
}

.auth-submit:hover {
    filter: brightness(0.93);
}

.auth-method-btn {
    border: 1px solid var(--auth-border);
    background: #fff;
    color: var(--auth-text);
}

.auth-method-btn:hover {
    border-color: var(--auth-primary);
    background: #f8fafc;
    color: var(--auth-text);
    text-decoration: none;
}

.auth-method-btn--primary {
    border-color: var(--auth-primary);
    background: var(--auth-primary);
    color: #fff;
}

.auth-method-btn--primary:hover {
    background: var(--auth-primary);
    color: #fff;
    filter: brightness(0.93);
}

.auth-method-btn__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    border-radius: 6px;
}

/* Keep the provider logos on a white tile so they stay recognisable on the filled button. */
.auth-method-btn--primary .auth-method-btn__icon {
    background: #fff;
    color: var(--auth-primary);
}

.auth-method-btn__label {
    text-align: center;
    line-height: 1.4;
}

.auth-method-btn__icon img {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

/* Visible keyboard focus everywhere (independent of the brand colour's contrast). */
.auth-submit:focus-visible,
.auth-method-btn:focus-visible,
.auth-field__action:focus-visible,
.auth-langs__item:focus-visible {
    outline: 3px solid #111827;
    outline-offset: 2px;
}

/* Loading state (set by the page script on submit / click). */
.auth-submit__spinner,
.auth-method-btn__spinner {
    display: none;
}

.is-loading .auth-submit__spinner,
.is-loading .auth-method-btn__spinner {
    display: inline-block;
}

.is-loading {
    pointer-events: none;
    opacity: 0.85;
}

.auth-divider {
    display: flex;
    gap: 12px;
    align-items: center;
    margin: 24px 0;
    font-size: 13px;
    color: var(--auth-muted);
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--auth-border);
}

.auth-methods {
    display: grid;
    gap: 12px;
}

/* ---------------------------------------------------------------- brand side */

.auth-hero {
    position: relative;
    flex: 1 1 50%;
    align-items: center;
    justify-content: center;
    padding: 56px;
    overflow: hidden;
    background-color: var(--auth-primary);
    background-position: center;
    background-size: cover;
    color: #fff;
    text-align: center;
}

/* No background image in the settings: soft circles in the client's colour instead of a flat block. */
.auth-hero--plain {
    background-image:
        radial-gradient(circle at 15% 20%, rgba(255, 255, 255, 0.16) 0, rgba(255, 255, 255, 0) 32%),
        radial-gradient(circle at 85% 80%, rgba(255, 255, 255, 0.12) 0, rgba(255, 255, 255, 0) 36%),
        radial-gradient(circle at 80% 15%, rgba(0, 0, 0, 0.10) 0, rgba(0, 0, 0, 0) 30%),
        linear-gradient(160deg, rgba(255, 255, 255, 0.06), rgba(0, 0, 0, 0.22));
}


.auth-hero__content {
    position: relative;
    max-width: 460px;
}

.auth-hero__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    margin-bottom: 24px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.14);
    font-size: 30px;
}

.auth-hero__title {
    margin: 0 0 12px;
    font-size: 40px;
    font-weight: 700;
    line-height: 1.2;
    color: #fff;
}

.auth-hero__slogan {
    margin: 0;
    font-size: 18px;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.92);
}

/* Large screens: the card grows with the page. */
@media (min-width: 1400px) {
    .auth-card {
        max-width: 540px;
        padding: 56px 52px;
    }

    .auth-card__title {
        font-size: 30px;
    }
}

/* ---------------------------------------------------------------- small screens */

@media (max-width: 575.98px) {
    .auth-panel {
        padding: 64px 12px 24px;
    }

    .auth-card {
        padding: 28px 20px;
        border: 0;
        box-shadow: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .auth-submit,
    .auth-method-btn {
        transition: none;
    }
}
