/* =============================================================================
   Pigee Auth Page — pigee-auth.css
   Follows pigee-global.css design system:
   Font: Helvetica Neue | Primary: #0064A8 | Light bg | Border: #e5e7eb
   ============================================================================= */

/* ── Page Layout ─────────────────────────────────────────────────────────── */

.pigee-auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    background: #f3f4f6;
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    color: #333;
}

/* ── Container ───────────────────────────────────────────────────────────── */

.pigee-auth-container {
    width: 100%;
    max-width: 460px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

/* ── Brand ───────────────────────────────────────────────────────────────── */

.pigee-auth-brand {
    text-align: center;
}

.pigee-auth-brand__logo {
    display: inline-block;
    text-decoration: none;
}

.pigee-auth-brand__img {
    height: 44px;
    width: auto;
    object-fit: contain;
}

.pigee-auth-brand__text {
    font-size: 1.75rem;
    font-weight: bold;
    color: #0064A8;
    letter-spacing: -0.02em;
}

.pigee-auth-brand__tagline {
    margin: 6px 0 0;
    font-size: 0.85rem;
    color: #6b7280;
}

/* ── Card ────────────────────────────────────────────────────────────────── */

.pigee-auth-card {
    width: 100%;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 32px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

/* ── Tabs ────────────────────────────────────────────────────────────────── */

.pigee-auth-tabs {
    position: relative;
    display: flex;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 28px;
    gap: 0;
}

.pigee-auth-tab {
    flex: 1;
    padding: 10px 12px;
    font-size: 0.9rem;
    font-weight: 500;
    color: #6b7280;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

.pigee-auth-tab:hover {
    color: #333;
}

.pigee-auth-tab.is-active {
    color: #0064A8;
    border-bottom-color: #0064A8;
    font-weight: bold;
}

/* Hide the JS-animated sliding indicator — border-bottom on tab handles it */
.pigee-auth-tab-indicator {
    display: none;
}

/* ── Alert Banner ────────────────────────────────────────────────────────── */

.pigee-auth-alert {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 0.875rem;
    border: 1px solid transparent;
    animation: pigeeAlertIn 0.2s ease;
}

.pigee-auth-alert[hidden] {
    display: none;
}

.pigee-auth-alert--error {
    background: #fef2f2;
    border-color: #fecaca;
    color: #b91c1c;
}

.pigee-auth-alert--success {
    background: #f0fdf4;
    border-color: #bbf7d0;
    color: #15803d;
}

@keyframes pigeeAlertIn {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.pigee-auth-alert__icon {
    flex-shrink: 0;
    font-weight: bold;
    font-size: 0.8rem;
    margin-top: 1px;
}

/* ── Panels ──────────────────────────────────────────────────────────────── */

.pigee-auth-panel {
    display: none;
}

.pigee-auth-panel.is-active {
    display: block;
    animation: pigeePanelIn 0.2s ease;
}

@keyframes pigeePanelIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Headings ────────────────────────────────────────────────────────────── */

.pigee-auth-heading {
    font-size: 1.3rem;
    font-weight: bold;
    color: #111;
    margin: 0 0 4px;
}

.pigee-auth-sub {
    font-size: 0.875rem;
    color: #6b7280;
    margin: 0 0 24px;
    line-height: 1.5;
}

/* ── Form & Fields ───────────────────────────────────────────────────────── */

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

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

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

.pigee-auth-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.pigee-auth-label {
    font-size: 0.85rem;
    font-weight: 500;
    color: #374151;
}

.pigee-auth-label span {
    color: #b91c1c;
}

/* Input wrapper */
.pigee-auth-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.pigee-auth-input-icon {
    position: absolute;
    left: 10px;
    width: 16px;
    height: 16px;
    color: #9ca3af;
    pointer-events: none;
    display: flex;
    align-items: center;
}

.pigee-auth-input-icon svg {
    width: 15px;
    height: 15px;
}

.pigee-auth-input {
    width: 100%;
    padding: 9px 12px 9px 34px;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    color: #333;
    font-size: 0.9rem;
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    outline: none;
    box-sizing: border-box;
    -webkit-appearance: none;
}

/* Fields without an icon — remove left indent */
.pigee-auth-input-wrap:not(:has(.pigee-auth-input-icon)) .pigee-auth-input {
    padding-left: 12px;
}

.pigee-auth-input::placeholder {
    color: #9ca3af;
}

.pigee-auth-input:focus {
    border-color: #0064A8;
    box-shadow: 0 0 0 3px rgba(0, 100, 168, 0.1);
}

.pigee-auth-input.is-error {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.08);
}

.pigee-auth-input.is-valid {
    border-color: #22c55e;
}

/* Password visibility toggle */
.pigee-auth-toggle-pw {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    color: #9ca3af;
    display: flex;
    align-items: center;
    transition: color 0.2s;
}

.pigee-auth-toggle-pw:hover {
    color: #374151;
}

.pigee-auth-toggle-pw svg {
    width: 15px;
    height: 15px;
}

/* Right padding when toggle button is present */
.pigee-auth-input-wrap:has(.pigee-auth-toggle-pw) .pigee-auth-input {
    padding-right: 36px;
}

/* Field-level error message */
.pigee-auth-field-error {
    font-size: 0.78rem;
    color: #b91c1c;
    min-height: 1rem;
    display: block;
}

/* ── Remember Me checkbox ────────────────────────────────────────────────── */

.pigee-auth-remember {
    margin: -4px 0;
}

.pigee-auth-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    color: #374151;
    cursor: pointer;
    user-select: none;
}

.pigee-auth-checkbox {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.pigee-auth-checkbox-custom {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    border: 1.5px solid #d1d5db;
    border-radius: 4px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.2s, background 0.2s;
}

.pigee-auth-checkbox:checked + .pigee-auth-checkbox-custom {
    background: #0064A8;
    border-color: #0064A8;
}

.pigee-auth-checkbox:checked + .pigee-auth-checkbox-custom::after {
    content: '';
    display: block;
    width: 9px;
    height: 5px;
    border-left: 2px solid #fff;
    border-bottom: 2px solid #fff;
    transform: rotate(-45deg) translateY(-1px);
}

/* ── Password Strength Meter ─────────────────────────────────────────────── */

.pigee-auth-strength {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}

.pigee-auth-strength__bar {
    flex: 1;
    height: 3px;
    background: #e5e7eb;
    border-radius: 99px;
    overflow: hidden;
}

.pigee-auth-strength__fill {
    display: block;
    height: 100%;
    width: 0%;
    border-radius: 99px;
    transition: width 0.3s ease, background 0.3s ease;
}

.pigee-auth-strength__fill[data-level="1"] { width: 25%; background: #ef4444; }
.pigee-auth-strength__fill[data-level="2"] { width: 50%; background: #f97316; }
.pigee-auth-strength__fill[data-level="3"] { width: 75%; background: #eab308; }
.pigee-auth-strength__fill[data-level="4"] { width: 100%; background: #22c55e; }

.pigee-auth-strength__label {
    font-size: 0.75rem;
    font-weight: 600;
    min-width: 44px;
    text-align: right;
    color: #6b7280;
}

/* ── Submit Button — matches .pigee-btn-primary-store ────────────────────── */

.pigee-auth-submit {
    width: 100%;
    padding: 10px 16px;
    background: #0064A8;
    border: 1px solid #0064A8;
    border-radius: 6px;
    color: #fff;
    font-size: 0.875rem;
    font-weight: 500;
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.2s, border-color 0.2s;
    margin-top: 4px;
}

.pigee-auth-submit:hover {
    background: #00539a;
    border-color: #00539a;
}

.pigee-auth-submit:active {
    background: #004a8a;
    border-color: #004a8a;
}

.pigee-auth-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.pigee-auth-submit__spinner {
    display: none;
    width: 15px;
    height: 15px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: pigeeSpinAnim 0.6s linear infinite;
}

.pigee-auth-submit.is-loading .pigee-auth-submit__spinner {
    display: block;
}

@keyframes pigeeSpinAnim {
    to { transform: rotate(360deg); }
}

/* ── Links ───────────────────────────────────────────────────────────────── */

.pigee-auth-link {
    background: none;
    border: none;
    padding: 0;
    color: #0064A8;
    font-size: inherit;
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: color 0.2s;
}

.pigee-auth-link:hover {
    color: #00539a;
    text-decoration: underline;
}

.pigee-auth-link--small {
    font-size: 0.8rem;
}

/* ── Terms ───────────────────────────────────────────────────────────────── */

.pigee-auth-terms {
    font-size: 0.8rem;
    color: #6b7280;
    margin: -4px 0;
    line-height: 1.5;
}

/* ── Switch row (bottom of each panel) ──────────────────────────────────── */

.pigee-auth-switch {
    text-align: center;
    font-size: 0.875rem;
    color: #6b7280;
    margin: 20px 0 0;
    padding-top: 20px;
    border-top: 1px solid #f3f4f6;
}

/* ── Footer ──────────────────────────────────────────────────────────────── */

.pigee-auth-footer {
    text-align: center;
}

.pigee-auth-footer__link {
    font-size: 0.82rem;
    color: #9ca3af;
    text-decoration: none;
    transition: color 0.2s;
}

.pigee-auth-footer__link:hover {
    color: #374151;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */

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

@media (max-width: 480px) {
    .pigee-auth-page {
        padding: 24px 10px;
        align-items: flex-start;
    }

    .pigee-auth-card {
        padding: 20px 15px;
    }

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

    .pigee-auth-heading {
        font-size: 1.15rem;
    }

    .pigee-auth-sub {
        font-size: 0.85rem;
        margin-bottom: 20px;
    }
}