/*
 * Feel Good MSP signed-out pages: guest layout and login.
 * Markup: resources/views/app/layouts/guest.blade.php and the auth/ pages (login, forgot and
 * reset password) with their auth/partials. The header bar is in partials/guest-header.css.
 */

/* The guest layout doesn't load Bootstrap, so set its box model here. */
.fg-guest *,
.fg-guest *::before,
.fg-guest *::after {
    box-sizing: border-box;
}

body.fg-guest {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    /* Soft brand glow behind the card. */
    background:
        radial-gradient(60rem 36rem at 15% -10%, rgba(46, 230, 207, .22), transparent 60%),
        radial-gradient(50rem 32rem at 100% 110%, rgba(140, 234, 243, .28), transparent 60%),
        #f6fbfa;
    --fg-auth-blue: #2563eb;
    --fg-auth-blue-hover: #1d4ed8;
    /* Sign-in buttons: a darker shade of the logo green, so white text stays readable. */
    --fg-auth-green: #0f7b5f;
    --fg-auth-green-hover: #0b664f;
    --fg-auth-green-tint: #ecfdf5;
    --fg-auth-border: #e5e7eb;
    --fg-auth-input-border: #d1d5db;
    --fg-auth-focus-ring: rgba(0, 150, 137, .2);
}

/* Page body: the form sits in the middle of the remaining space. */
.fg-guest__main {
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: center;
    padding: 48px 16px;
}

.fg-auth {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 420px;
}

.fg-auth__logo {
    display: block;
    width: 100%;
    max-width: 260px;
    height: auto;
    margin: 0 auto 32px;
}

.fg-auth__card {
    /* Shared with the full-width card footer (partials/auth/back-to-sign-in.css). */
    --fg-auth-card-pad-y: 40px;
    --fg-auth-card-pad-x: 40px;

    padding: var(--fg-auth-card-pad-y) var(--fg-auth-card-pad-x);
    border: 1px solid rgba(229, 231, 235, .8);
    border-radius: 16px;
    background: var(--fg-surface);
    box-shadow: 0 1px 2px rgba(2, 47, 46, .04), 0 12px 32px -8px rgba(2, 47, 46, .12);
}

/* Heading inside the card */
.fg-auth__title {
    margin: 0 0 6px;
    color: var(--fg-ink);
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -.02em;
}

.fg-auth__intro {
    margin: 0 0 28px;
    color: #4b5563;
    font-size: 15px;
    line-height: 1.5;
}

/* Form */
.fg-auth__field + .fg-auth__field {
    margin-top: 20px;
}

.fg-auth__label {
    display: block;
    margin: 0 0 8px;
    color: var(--fg-ink);
    font-size: 14px;
    font-weight: 600;
}

/* Label with a link on the right, e.g. Password / Forgot password? */
.fg-auth__label-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.fg-auth__label-row .fg-auth__label {
    margin: 0;
}

.fg-auth__input {
    display: block;
    width: 100%;
    height: 44px;
    padding: 0 14px;
    border: 1px solid var(--fg-auth-input-border);
    border-radius: 10px;
    background: var(--fg-surface);
    color: var(--fg-ink);
    font: inherit;
    font-size: 15px;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.fg-auth__input:hover {
    border-color: #9ca3af;
}

.fg-auth__input:focus {
    border-color: #009689;
    outline: none;
    box-shadow: 0 0 0 4px var(--fg-auth-focus-ring);
}

/* Password field with a show/hide button inside it */
.fg-auth__password {
    position: relative;
}

.fg-auth__password .fg-auth__input {
    padding-right: 44px;
}

.fg-auth__reveal {
    position: absolute;
    top: 50%;
    right: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #6b7280;
    cursor: pointer;
    transform: translateY(-50%);
}

.fg-auth__reveal:hover {
    color: var(--fg-ink);
}

.fg-auth__reveal:focus-visible {
    outline: 2px solid #009689;
    outline-offset: 0;
}

.fg-auth__reveal[hidden] {
    display: none;
}

.fg-auth__reveal .fg-auth__reveal-hide,
.fg-auth__reveal[aria-pressed="true"] .fg-auth__reveal-show {
    display: none;
}

.fg-auth__reveal[aria-pressed="true"] .fg-auth__reveal-hide {
    display: block;
}

.fg-auth__forgot {
    color: var(--fg-auth-green);
    font-size: 13px;
    font-weight: 600;
}

.fg-auth__forgot:hover,
.fg-auth__forgot:focus {
    color: var(--fg-auth-green-hover);
}

.fg-auth__remember {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 20px 0 0;
    color: #374151;
    font-size: 14px;
    font-weight: 400;
    cursor: pointer;
}

.fg-auth__remember input {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--fg-auth-green);
}

.fg-auth__submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    height: 44px;
    margin-top: 24px;
    border: 0;
    border-radius: 10px;
    background: var(--fg-auth-green);
    box-shadow: 0 1px 2px rgba(2, 47, 46, .12), 0 4px 12px -4px rgba(15, 123, 95, .45);
    color: #ffffff;
    font: inherit;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color .15s ease, transform .15s ease;
}

.fg-auth__submit:active {
    transform: translateY(1px);
}

/* Sending: spinner shown, button held (components/auth/submit.blade.php, auth-submit.js). */
.fg-auth__submit.is-busy,
.fg-auth__submit.is-busy:hover {
    background: var(--fg-auth-green-hover);
    cursor: progress;
    transform: none;
}

/* Spinner, also used by the passkey button. Hidden until its button is busy. */
.fg-auth__spinner {
    display: none;
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: fg-auth-spin .7s linear infinite;
}

.fg-auth__submit.is-busy .fg-auth__spinner {
    display: inline-block;
}

@keyframes fg-auth-spin {
    to {
        transform: rotate(360deg);
    }
}

.fg-auth__submit:hover,
.fg-auth__submit:focus-visible {
    background: var(--fg-auth-green-hover);
}

.fg-auth__submit:focus-visible {
    outline: 2px solid var(--fg-ink);
    outline-offset: 2px;
}

.fg-auth__register {
    margin: 20px 0 0;
    color: #4b5563;
    font-size: 14px;
    text-align: center;
}

.fg-auth__register a {
    color: var(--fg-auth-green);
    font-weight: 600;
}

/* Phones: the card blends into the page, edge to edge. */
@media (max-width: 479.98px) {
    .fg-guest__main {
        align-items: flex-start;
        padding: 32px 16px;
    }

    .fg-auth__card {
        --fg-auth-card-pad-y: 28px;
        --fg-auth-card-pad-x: 20px;

        border-radius: 14px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .fg-auth__input,
    .fg-auth__submit {
        transition: none;
    }

    /* Still shows progress, just slower. */
    .fg-auth__spinner {
        animation-duration: 1.6s;
    }
}
