/* Header auth area (every page) + the /login card. */

/* ------------------------------------------------------------------ header */

.auth-area {
    display: flex;
    align-items: center;
    min-width: 32px;
    min-height: 32px;
    justify-content: flex-end;
}

.auth-skel {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background-color: #e5e7eb;
    animation: auth-pulse 1.4s ease-in-out infinite;
}

@keyframes auth-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.45; }
}

.auth-signin {
    color: var(--select-color);
    text-decoration: none;
    font-size: 0.9em;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid #e5e7eb;
    transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
    white-space: nowrap;
}

.auth-signin:hover {
    color: var(--thermist-blue);
    border-color: var(--thermist-blue);
    background-color: var(--thermist-blue-transparent);
    text-decoration: none;
}

.auth-menu {
    position: relative;
}

.auth-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    padding: 0;
    overflow: hidden;
    background-color: var(--thermist-blue);
    color: #fff;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 500;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: box-shadow 0.2s ease;
}

.auth-avatar:hover,
.auth-avatar:focus {
    outline: none;
    box-shadow: 0 0 0 3px var(--thermist-blue-transparent);
}

.auth-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.auth-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    min-width: 200px;
    background-color: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    padding: 6px 0;
    visibility: hidden;
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
    z-index: 1200;
    text-align: left;
}

.auth-menu:hover .auth-dropdown,
.auth-menu.open .auth-dropdown {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
}

.auth-dd-head {
    padding: 8px 14px 10px;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 6px;
}

.auth-dd-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--primary-color);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.auth-dd-email {
    font-size: 0.78rem;
    color: #555555;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.auth-dropdown a,
.auth-dropdown button {
    display: block;
    width: 100%;
    box-sizing: border-box;
    text-align: left;
    padding: 9px 14px;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--primary-color);
    background: none;
    border: none;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.auth-dropdown a:hover,
.auth-dropdown button:hover {
    background-color: var(--neutral-color);
    color: var(--thermist-blue);
    text-decoration: none;
}

.sidebar .menu-item.sidebar-auth {
    border-top: 1px solid #e5e7eb;
}

.sidebar .menu-item.sidebar-auth + .menu-item.sidebar-auth {
    border-top: none;
}

/* ------------------------------------------------------------------ /login */

.auth-page {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 40px 20px 80px;
    margin-top: var(--expanded-header-height);
}

.auth-card {
    width: 100%;
    max-width: 400px;
    background-color: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    padding: 36px 32px 32px;
    box-sizing: border-box;
    text-align: center;
}

.auth-card h1 {
    font-size: 1.5rem;
    font-weight: 500;
    color: var(--primary-color);
    margin: 0 0 6px;
}

.auth-card .auth-note {
    font-size: 0.88rem;
    color: #555555;
    line-height: 1.5;
    margin: 0 0 24px;
}

.auth-google-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    box-sizing: border-box;
    padding: 13px 20px;
    border-radius: 999px;
    border: 1px solid #e5e7eb;
    background-color: #fff;
    color: var(--primary-color);
    font-family: inherit;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.auth-google-btn:hover:not(:disabled) {
    background-color: var(--neutral-color);
    border-color: #cccccc;
}

.auth-google-btn:disabled {
    opacity: 0.6;
    cursor: default;
}

.auth-google-btn svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.auth-error {
    background-color: #fdecec;
    border: 1px solid #f5c2c0;
    color: #a12622;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 0.85rem;
    line-height: 1.45;
    text-align: left;
    margin-bottom: 18px;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 24px 0 18px;
    color: #999999;
    font-size: 0.72rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background-color: #e5e7eb;
}

.auth-stub-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    text-align: left;
}

.auth-stub-form label {
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #808080;
}

.auth-input {
    width: 100%;
    box-sizing: border-box;
    padding: 11px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--primary-color);
    background-color: #fff;
}

.auth-input:focus {
    outline: none;
    border-color: var(--thermist-blue);
    box-shadow: 0 0 0 3px var(--thermist-blue-transparent);
}

.auth-secondary-btn {
    width: 100%;
    box-sizing: border-box;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    background-color: var(--thermist-blue);
    color: #fff;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.auth-secondary-btn:hover:not(:disabled) {
    background-color: var(--thermist-blue-dark);
}

.auth-secondary-btn:disabled {
    opacity: 0.6;
    cursor: default;
}

.auth-info {
    background-color: #eaf4fb;
    border: 1px solid #bcdcf0;
    color: #1f4e6d;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 0.85rem;
    line-height: 1.45;
    text-align: left;
    margin-bottom: 18px;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    text-align: left;
}

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

.auth-field label {
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #808080;
}

.auth-links {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin: 16px 0 0;
    font-size: 0.85rem;
}

.auth-links a {
    color: var(--thermist-blue);
    text-decoration: none;
}

.auth-links a:hover {
    text-decoration: underline;
}

.auth-terms {
    margin: 20px 0 0;
    font-size: 0.78rem;
    line-height: 1.5;
    color: #6b7a89;
    text-align: center;
}

.auth-terms a {
    color: inherit;
    text-decoration: underline;
}

/* The mode link keeps to the right when the forgot link is hidden. */
.auth-links a:last-child {
    margin-left: auto;
}

.auth-verify-text {
    font-size: 0.92rem;
    color: #444444;
    line-height: 1.5;
    margin: 0 0 18px;
    overflow-wrap: anywhere;
}

.auth-stub-hint {
    font-size: 0.8rem;
    color: #808080;
    margin: 12px 0 0;
    line-height: 1.45;
}

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

/* The hidden attribute must win over the display rules above. */
.auth-area [hidden],
.auth-page [hidden],
.acct-page [hidden] {
    display: none !important;
}
