/* ═══════════════════════════════════════════════════════
   Login Dialog — popup sign-in / forgot-password form
   Triggered by any element with class .pb-login-trigger
   ═══════════════════════════════════════════════════════ */

/* Overlay */
.pb-login-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 100000;
    background: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
}
.pb-login-overlay.is-open {
    display: flex;
}

/* Dialog box */
.pb-login-dialog {
    background: #fff;
    border-radius: 8px;
    max-width: 420px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    animation: pb-login-fadein 0.2s ease-out;
}
@keyframes pb-login-fadein {
    from { opacity: 0; transform: translateY(-12px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Header */
.pb-login-dialog__header {
    background: #1e293b;
    color: #fff;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.pb-login-dialog__title {
    font-size: 17px;
    font-weight: 600;
    margin: 0;
    line-height: 1.3;
}
.pb-login-dialog__close {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    line-height: 0;
    border-radius: 4px;
    transition: color 0.15s;
}
.pb-login-dialog__close:hover {
    color: #fff;
}

/* Body */
.pb-login-dialog__body {
    padding: 24px 20px 20px;
}

/* Views — only the active one is visible */
.pb-login-view { display: none; }
.pb-login-view.is-active { display: block; }

/* Form fields */
.pb-login-field {
    margin-bottom: 16px;
}
.pb-login-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 5px;
}
.pb-login-field input {
    width: 100%;
    padding: 10px 12px;
    font-size: 15px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #fff;
    color: #1e293b;
    outline: none;
    transition: border-color 0.15s;
    box-sizing: border-box;
}
.pb-login-field input:focus {
    border-color: #F4C542;
    box-shadow: 0 0 0 3px rgba(244, 197, 66, 0.15);
}

/* Buttons row */
.pb-login-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}
.pb-login-btn {
    flex: 1;
    padding: 10px 16px;
    font-size: 15px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: opacity 0.15s;
    line-height: 1.3;
}
.pb-login-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
.pb-login-btn--primary {
    background: #F4C542;
    color: #1e293b;
}
.pb-login-btn--primary:hover:not(:disabled) {
    background: #e5b73a;
}
.pb-login-btn--cancel {
    background: #f1f5f9;
    color: #475569;
}
.pb-login-btn--cancel:hover:not(:disabled) {
    background: #e2e8f0;
}

/* Link row (forgot / back) */
.pb-login-link-row {
    margin-top: 14px;
    text-align: center;
}
.pb-login-link-row a {
    font-size: 13px;
    color: #6b7280;
    text-decoration: none;
    cursor: pointer;
}
.pb-login-link-row a:hover {
    color: #1e293b;
    text-decoration: underline;
}

/* Message areas */
.pb-login-message {
    display: none;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 16px;
}
.pb-login-message.is-visible { display: block; }
.pb-login-message--error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}
.pb-login-message--success {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

/* Mobile — align dialog to top on small screens for better keyboard UX */
@media (max-width: 480px) {
    .pb-login-overlay {
        align-items: flex-start;
        padding-top: 10vh;
    }
    .pb-login-dialog {
        width: 92%;
        max-width: none;
    }
    .pb-login-dialog__body {
        padding: 20px 16px 16px;
    }
    .pb-login-field input {
        font-size: 16px; /* prevents iOS zoom on focus */
    }
}
