/*
|--------------------------------------------------------------------------
| ClearMind Authentication — Centered Layout
|--------------------------------------------------------------------------
*/

:root {
    --cm-auth-primary: #11845f;
    --cm-auth-primary-dark: #075f43;
    --cm-auth-primary-soft: #e9f8f1;
    --cm-auth-ink: #14251f;
    --cm-auth-text: #40534b;
    --cm-auth-muted: #7b8a84;
    --cm-auth-border: #dfe9e4;
    --cm-auth-page: #f5f7f3;
    --cm-auth-danger: #b64b4b;
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body.cm-auth-body {
    min-height: 100vh;
    margin: 0;
    background: var(--cm-auth-page);
    color: var(--cm-auth-text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
}

button,
input {
    font: inherit;
}

.cm-auth-page {
    min-height: 100vh;
    display: grid;
    grid-template-rows: auto 1fr auto;
}

.cm-auth-header {
    position: relative;
    z-index: 5;
    width: 100%;
    min-height: 82px;
    padding: 18px clamp(22px, 4vw, 58px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.cm-auth-logo {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    color: var(--cm-auth-ink);
    text-decoration: none;
}

.cm-auth-logo-mark {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, var(--cm-auth-primary-dark), var(--cm-auth-primary));
    color: #fff;
    font-size: 24px;
    font-weight: 900;
    box-shadow: 0 12px 26px rgba(17, 132, 95, 0.18);
}

.cm-auth-logo-copy {
    display: flex;
    flex-direction: column;
    line-height: 1;
}

.cm-auth-logo-copy strong {
    color: var(--cm-auth-ink);
    font-size: 19px;
    letter-spacing: -0.035em;
}

.cm-auth-logo-copy small {
    margin-top: 5px;
    color: var(--cm-auth-primary);
    font-size: 8px;
    font-weight: 850;
    letter-spacing: 0.22em;
}

.cm-auth-header-action {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cm-auth-top-question {
    color: var(--cm-auth-muted);
    font-size: 10px;
}

.cm-auth-top-link {
    min-height: 38px;
    padding: 0 14px;
    border: 1px solid var(--cm-auth-border);
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.85);
    color: var(--cm-auth-primary-dark);
    font-size: 10px;
    font-weight: 850;
    text-decoration: none;
    box-shadow: 0 8px 20px rgba(32, 74, 59, 0.04);
}

.cm-auth-top-link:hover {
    border-color: rgba(17, 132, 95, 0.35);
    background: var(--cm-auth-primary-soft);
}

.cm-auth-main {
    position: relative;
    min-height: 0;
    padding: 30px 20px 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.cm-auth-backdrop-shape {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}

.cm-auth-backdrop-shape-one {
    width: 420px;
    height: 420px;
    left: -250px;
    top: 10%;
    border: 70px solid rgba(17, 132, 95, 0.035);
}

.cm-auth-backdrop-shape-two {
    width: 310px;
    height: 310px;
    right: -170px;
    bottom: -130px;
    background: rgba(17, 132, 95, 0.035);
}

.cm-auth-card-wrap {
    position: relative;
    z-index: 2;
    width: min(100%, 540px);
    margin: auto;
}

.cm-auth-register-page .cm-auth-card-wrap {
    width: min(100%, 560px);
}

.cm-auth-card {
    padding: 36px 40px;
    border: 1px solid rgba(216, 229, 223, 0.95);
    border-radius: 27px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 24px 62px rgba(33, 76, 61, 0.10);
}

.cm-auth-heading {
    margin-bottom: 25px;
    text-align: center;
}

.cm-auth-eyebrow {
    color: var(--cm-auth-primary);
    font-size: 10px;
    font-weight: 850;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.cm-auth-heading h2 {
    margin: 8px 0 8px;
    color: var(--cm-auth-ink);
    font-size: 31px;
    line-height: 1.15;
    letter-spacing: -0.04em;
}

.cm-auth-heading p {
    max-width: 390px;
    margin: 0 auto;
    color: var(--cm-auth-muted);
    font-size: 11px;
    line-height: 1.65;
}

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

.cm-auth-field label {
    margin-bottom: 7px;
    display: block;
    color: var(--cm-auth-ink);
    font-size: 10px;
    font-weight: 800;
}

.cm-auth-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.cm-auth-label-row a {
    color: var(--cm-auth-primary-dark);
    font-size: 9px;
    font-weight: 750;
    text-decoration: none;
}

.cm-auth-field input {
    width: 100%;
    min-height: 51px;
    padding: 0 15px;
    border: 1px solid var(--cm-auth-border);
    border-radius: 14px;
    outline: none;
    background: #fff;
    color: var(--cm-auth-text);
    font-size: 11px;
    transition: border-color 160ms ease, box-shadow 160ms ease;
}

.cm-auth-field input:focus {
    border-color: var(--cm-auth-primary);
    box-shadow: 0 0 0 4px rgba(17, 132, 95, 0.09);
}

.cm-auth-field input[readonly] {
    background: #f6f9f7;
    color: var(--cm-auth-muted);
}

.cm-auth-field small.is-error {
    margin-top: 6px;
    display: block;
    color: var(--cm-auth-danger);
    font-size: 9px;
    font-weight: 750;
}

.cm-auth-password {
    position: relative;
}

.cm-auth-password input {
    padding-right: 63px;
}

.cm-auth-password button {
    position: absolute;
    top: 50%;
    right: 8px;
    min-width: 45px;
    height: 34px;
    padding: 0 9px;
    border: 0;
    border-radius: 10px;
    background: var(--cm-auth-primary-soft);
    color: var(--cm-auth-primary-dark);
    cursor: pointer;
    font-size: 8px;
    font-weight: 850;
    transform: translateY(-50%);
}

.cm-auth-check {
    width: fit-content;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--cm-auth-muted);
    cursor: pointer;
    font-size: 9px;
}

.cm-auth-check input {
    width: 15px;
    height: 15px;
    accent-color: var(--cm-auth-primary);
}

.cm-auth-primary {
    width: 100%;
    min-height: 51px;
    padding: 0 16px;
    border: 0;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, var(--cm-auth-primary-dark), var(--cm-auth-primary));
    color: #fff;
    cursor: pointer;
    font-size: 11px;
    font-weight: 850;
    box-shadow: 0 14px 26px rgba(17, 132, 95, 0.18);
    transition: transform 150ms ease, box-shadow 150ms ease;
}

.cm-auth-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 17px 32px rgba(17, 132, 95, 0.23);
}

.cm-auth-primary span {
    font-size: 17px;
    line-height: 1;
}

.cm-auth-divider {
    margin: 21px 0;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--cm-auth-muted);
    font-size: 8px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

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

.cm-auth-google {
    width: 100%;
    min-height: 50px;
    padding: 0 14px;
    border: 1px solid var(--cm-auth-border);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: #fff;
    color: var(--cm-auth-ink);
    font-size: 10px;
    font-weight: 800;
    text-decoration: none;
}

.cm-auth-google:hover {
    border-color: rgba(17, 132, 95, 0.35);
    background: #fbfefd;
}

.cm-auth-google > span {
    width: 27px;
    height: 27px;
    border: 1px solid var(--cm-auth-border);
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #4285f4;
    font-size: 12px;
    font-weight: 900;
}

.cm-auth-bottom-copy {
    margin: 21px 0 0;
    color: var(--cm-auth-muted);
    font-size: 9px;
    text-align: center;
}

.cm-auth-bottom-copy a,
.cm-auth-legal-copy a {
    color: var(--cm-auth-primary-dark);
    font-weight: 800;
    text-decoration: none;
}

.cm-auth-legal-copy {
    margin: -2px 0 0;
    color: var(--cm-auth-muted);
    font-size: 8px;
    line-height: 1.65;
    text-align: center;
}

.cm-auth-alert {
    margin-bottom: 18px;
    padding: 12px 13px;
    border: 1px solid;
    border-radius: 13px;
    display: flex;
    align-items: flex-start;
    gap: 9px;
    font-size: 9px;
    line-height: 1.5;
}

.cm-auth-alert > span {
    width: 22px;
    height: 22px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    font-weight: 900;
}

.cm-auth-alert p {
    margin: 2px 0 0;
}

.cm-auth-alert.is-success {
    border-color: #cdeedf;
    background: #f2fff8;
    color: #176748;
}

.cm-auth-alert.is-success > span {
    background: #d9f7e9;
}

.cm-auth-alert.is-error {
    border-color: #f0d0d0;
    background: #fff7f7;
    color: var(--cm-auth-danger);
}

.cm-auth-alert.is-error > span {
    background: #ffe6e6;
}

.cm-auth-symbol {
    width: 58px;
    height: 58px;
    margin: 0 auto 18px;
    border-radius: 19px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--cm-auth-primary-soft);
    color: var(--cm-auth-primary-dark);
    font-size: 22px;
    font-weight: 900;
}

.cm-auth-symbol.is-mail {
    font-size: 19px;
}

.cm-auth-info-box {
    margin: 20px 0;
    padding: 14px;
    border: 1px solid var(--cm-auth-border);
    border-radius: 14px;
    background: #f8fbfa;
    text-align: center;
}

.cm-auth-info-box strong {
    color: var(--cm-auth-ink);
    font-size: 10px;
}

.cm-auth-info-box p {
    margin: 5px 0 0;
    color: var(--cm-auth-muted);
    font-size: 9px;
    line-height: 1.55;
}

.cm-auth-logout-form {
    margin-top: 14px;
    text-align: center;
}

.cm-auth-logout-form button {
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--cm-auth-muted);
    cursor: pointer;
    font-size: 9px;
    text-decoration: underline;
}

.cm-auth-footer {
    min-height: 58px;
    padding: 14px clamp(22px, 4vw, 58px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    color: var(--cm-auth-muted);
    font-size: 8px;
}

.cm-auth-footer > div {
    display: flex;
    align-items: center;
    gap: 15px;
}

.cm-auth-footer a {
    text-decoration: none;
}

@media (max-width: 640px) {
    .cm-auth-header {
        min-height: 72px;
        padding: 14px 16px;
    }

    .cm-auth-logo-copy {
        display: none;
    }

    .cm-auth-top-question {
        display: none;
    }

    .cm-auth-main {
        padding: 20px 14px 32px;
    }

    .cm-auth-card {
        padding: 28px 20px;
        border-radius: 22px;
    }

    .cm-auth-heading h2 {
        font-size: 26px;
    }

    .cm-auth-footer {
        padding: 14px 16px;
        flex-wrap: wrap;
        justify-content: center;
    }
}
