.z-auth-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.z-auth-page {
    display: flex;
    justify-content: center;
    width: 100%;
    padding: 3rem 1rem 4rem;
}

.z-auth-modal {
    width: 100%;
    max-width: 420px;
    background: #fff;
    border-radius: 0.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    padding: 1.25rem;
}

.z-auth-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.z-auth-message {
    margin-bottom: 1rem;
    color: #555;
}

.z-auth-countdown {
    gap: 4px;
    margin-bottom: 1rem;
}

.z-auth-field {
    margin-bottom: 1rem;
}

.z-auth-field label {
    display: block;
    margin-bottom: 0.35rem;
    font-weight: 600;
}

.z-auth-field input {
    width: 100%;
    box-sizing: border-box;
    padding: 0.65rem 0.75rem;
}

.z-auth-code-field[hidden] {
    display: none;
}

.z-auth-remember {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.z-auth-error {
    color: #b00020;
    margin-bottom: 1rem;
}

.z-auth-success {
    color: #166534;
    margin-bottom: 1rem;
}

.z-auth-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

.z-auth-buttons button {
    padding: 0.6rem 1rem;
    cursor: pointer;
}

.z-auth-page .z-auth-form .z-auth-buttons {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    justify-items: stretch;
    width: 100%;
    gap: 0.65rem;
}

.z-auth-page .z-auth-form .z-auth-submit,
.z-auth-page .z-auth-form .z-auth-secondary-button,
.z-auth-provider-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 44px;
    padding: 0.6rem 1rem;
    font-weight: 700;
    border: none;
    border-radius: 4px;
    text-align: center;
}

.z-auth-provider-list {
    display: grid;
    gap: 0.65rem;
    margin-bottom: 1rem;
}

.z-auth-provider-button {
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #111827;
    text-decoration: none;
}

.z-auth-provider-button:hover,
.z-auth-provider-button:focus {
    border-color: #94a3b8;
    background: #f8fafc;
    color: #111827;
    text-decoration: none;
}

.z-auth-provider-github {
    border-color: #111827;
}

.z-auth-provider-google {
    border-color: #d1d5db;
}

.z-auth-provider-facebook {
    border-color: #2563eb;
}

.z-auth-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0.25rem 0 1rem;
    color: #6b7280;
    font-size: 0.9rem;
}

.z-auth-divider::before,
.z-auth-divider::after {
    content: "";
    flex: 1;
    border-top: 1px solid #e5e7eb;
}

.z-auth-page .z-auth-form .z-auth-submit {
    background-color: #3b82f6;
    color: #fff;
    cursor: pointer;
    text-decoration: none;
}

.z-auth-page .z-auth-form .z-auth-submit:hover,
.z-auth-page .z-auth-form .z-auth-submit:focus {
    background-color: #2563eb;
    color: #fff;
    text-decoration: none;
}

.z-auth-page .z-auth-complete-actions .z-auth-buttons {
    display: flex;
    justify-content: flex-start;
}

.z-auth-page .z-auth-complete-actions .z-auth-submit {
    width: auto;
    min-height: 36px;
    padding: 0.5rem 0.9rem;
}

.z-auth-secondary-button {
    border: 1px solid #3b82f6;
    background-color: #fff;
    color: #2563eb;
    text-decoration: none;
}

.z-auth-secondary-button:hover,
.z-auth-secondary-button:focus {
    border-color: #2563eb;
    background-color: #eff6ff;
    color: #1d4ed8;
    text-decoration: none;
}

.z-auth-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.35rem 0.75rem;
    margin-top: 1rem;
    font-size: 0.92rem;
}

.z-auth-link {
    color: #2563eb;
    text-decoration: none;
}

.z-auth-link:hover,
.z-auth-link:focus {
    text-decoration: underline;
}

@media (max-width: 480px) {
    .z-auth-page {
        padding: max(6rem, calc(env(safe-area-inset-top) + 4rem)) 0.75rem 2.5rem;
    }

    .z-auth-modal {
        padding: 1rem;
    }
}
