/* ================================================================
   Auth pages — login.php / register.php
   Design tokens are inherited from main.css (:root)
   ================================================================ */

/* ---- Page layout ---- */

.auth-page {
    min-height: calc(100vh - var(--header-h) - 80px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 16px;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 40px 36px;
    box-shadow: var(--shadow-md);
}

.auth-card--wide {
    max-width: 480px;
}

/* ---- Logo ---- */

.auth-logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 28px;
    text-decoration: none;
    color: var(--text-base);
}

.auth-logo span {
    font-size: 16px;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.auth-logo:hover { text-decoration: none; }

/* ---- Headings ---- */

.auth-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-base);
    letter-spacing: -0.02em;
    margin: 0 0 6px;
    line-height: 1.25;
}

.auth-subtitle {
    font-size: 14px;
    color: var(--text-muted);
    margin: 0 0 24px;
    line-height: 1.6;
}

/* ---- Notices ---- */

.auth-notice {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    font-size: 13px;
    line-height: 1.5;
    margin-bottom: 20px;
}

.auth-notice svg {
    flex-shrink: 0;
    margin-top: 1px;
}

.auth-notice--error {
    background: var(--color-red-bg);
    color: var(--color-red);
    border: 1px solid #FECACA;
}

.auth-notice--success {
    background: var(--color-green-bg);
    color: var(--color-green);
    border: 1px solid #BBF7D0;
}

.auth-notice a {
    color: inherit;
    font-weight: 500;
    text-decoration: underline;
}

/* ---- Form ---- */

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.auth-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.auth-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.auth-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-base);
}

.auth-label__link {
    font-weight: 400;
    font-size: 12px;
    color: var(--color-primary);
}

.auth-label__hint {
    font-weight: 400;
    font-size: 12px;
    color: var(--text-subtle);
}

.auth-required {
    color: var(--color-red);
    margin-left: 2px;
}

/* ---- Input ---- */

.auth-input-wrap {
    position: relative;
}

.auth-input {
    display: block;
    width: 100%;
    padding: 9px 12px;
    font-family: var(--font);
    font-size: 14px;
    color: var(--text-base);
    background: var(--bg-card);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    outline: none;
    transition: border-color .15s, box-shadow .15s;
    appearance: none;
}

.auth-input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}

.auth-input-wrap .auth-input {
    padding-right: 40px;
}

.auth-input--ok  { border-color: var(--color-green) !important; }
.auth-input--err { border-color: var(--color-red) !important; }

/* ---- Toggle password button ---- */

.auth-toggle-pw {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    padding: 0;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-subtle);
    transition: color .15s;
}

.auth-toggle-pw:hover { color: var(--text-muted); }

/* ---- Password strength ---- */

.auth-pw-strength {
    font-size: 12px;
    font-weight: 500;
    margin-top: 2px;
    min-height: 16px;
}

.auth-pw-strength--weak       { color: var(--color-red); }
.auth-pw-strength--fair       { color: var(--color-yellow); }
.auth-pw-strength--good       { color: #2563EB; }
.auth-pw-strength--strong     { color: var(--color-green); }
.auth-pw-strength--very-strong{ color: var(--color-green); }

/* ---- Checkbox ---- */

.auth-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-muted);
    cursor: pointer;
    user-select: none;
}

.auth-checkbox input[type="checkbox"] {
    width: 15px;
    height: 15px;
    accent-color: var(--color-primary);
    cursor: pointer;
    flex-shrink: 0;
}

/* ---- Submit button ---- */

.auth-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 11px 20px;
    background: var(--color-primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, transform .1s;
    text-decoration: none;
    margin-top: 4px;
}

.auth-submit:hover  { background: var(--color-primary-h); text-decoration: none; color: #fff; }
.auth-submit:active { transform: scale(.985); }

.auth-submit--inline {
    display: inline-flex;
    width: auto;
    margin-top: 16px;
}

/* ---- Footer link ---- */

.auth-footer-link {
    margin-top: 20px;
    font-size: 13px;
    color: var(--text-muted);
    text-align: center;
}

.auth-footer-link a {
    color: var(--color-primary);
    font-weight: 500;
}

/* ---- Success state ---- */

.auth-success-state {
    text-align: center;
}

.auth-success-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.auth-hint {
    margin-top: 16px;
    font-size: 13px;
    color: var(--text-subtle);
}

/* ---- Responsive ---- */

@media (max-width: 520px) {
    .auth-card {
        padding: 28px 20px;
    }

    .auth-row {
        grid-template-columns: 1fr;
    }
}
