/* ═══════════════════════════════════════════════
   Login/Register Widget Sha2w — Styles
   ═══════════════════════════════════════════════ */

/* ── Trigger Button ─────────────────────────── */
.sha2w-widget-wrap { display: inline-block; }

.sha2w-trigger-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 24px;
    background: #6c63ff;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background .22s, box-shadow .22s, transform .15s;
    letter-spacing: .3px;
    line-height: 1;
}
.sha2w-trigger-btn:hover {
    background: #574fd6;
    box-shadow: 0 6px 20px rgba(108,99,255,.35);
    transform: translateY(-1px);
}
.sha2w-trigger-btn:active { transform: translateY(0); }
.sha2w-trigger-btn i, .sha2w-trigger-btn svg { width:16px; height:16px; }

/* ── Overlay ─────────────────────────────────── */
.sha2w-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;
    background: rgba(0,0,0,.55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity .28s ease, visibility .28s ease;
    backdrop-filter: blur(3px);
}
.sha2w-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ── Popup Box ───────────────────────────────── */
.sha2w-popup-box {
    position: relative;
    width: 460px;
    max-width: 100%;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 30px 80px rgba(0,0,0,.18), 0 2px 12px rgba(0,0,0,.08);
    padding: 0;
    transform: translateY(30px) scale(.97);
    transition: transform .3s cubic-bezier(.34,1.56,.64,1), opacity .28s ease;
    opacity: 0;
    overflow: hidden;
    max-height: 92vh;
    overflow-y: auto;
}
.sha2w-overlay.active .sha2w-popup-box {
    transform: translateY(0) scale(1);
    opacity: 1;
}

/* Scrollbar inside popup */
.sha2w-popup-box::-webkit-scrollbar { width: 5px; }
.sha2w-popup-box::-webkit-scrollbar-track { background: transparent; }
.sha2w-popup-box::-webkit-scrollbar-thumb { background: #ddd; border-radius: 10px; }

/* ── Close Button ────────────────────────────── */
.sha2w-close-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 10;
    width: 34px;
    height: 34px;
    border: none;
    background: #f3f3f7;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #888;
    transition: background .18s, color .18s, transform .15s;
}
.sha2w-close-btn:hover { background: #e8e8f0; color: #333; transform: rotate(90deg); }

/* ── Tabs ────────────────────────────────────── */
.sha2w-tabs {
    display: flex;
    border-bottom: 2px solid #f0f0f5;
    padding: 0 28px;
    background: #fafafa;
}
.sha2w-tab-btn {
    flex: 1;
    padding: 18px 0 16px;
    border: none;
    background: none;
    font-size: 14px;
    font-weight: 600;
    color: #bbb;
    cursor: pointer;
    border-bottom: 2.5px solid transparent;
    margin-bottom: -2px;
    transition: color .2s, border-color .2s;
    letter-spacing: .4px;
    text-transform: uppercase;
}
.sha2w-tab-btn.active {
    color: #6c63ff;
    border-bottom-color: #6c63ff;
}
.sha2w-tab-btn:hover:not(.active) { color: #888; }

/* ── Panel ───────────────────────────────────── */
.sha2w-panel {
    display: none;
    padding: 28px 32px 32px;
    animation: sha2wFadeIn .25s ease forwards;
}
.sha2w-panel.active { display: block; }

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

/* ── Form Head ───────────────────────────────── */
.sha2w-form-head { margin-bottom: 24px; }
.sha2w-form-title {
    font-size: 22px;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 5px;
    line-height: 1.2;
}
.sha2w-form-subtitle {
    font-size: 13.5px;
    color: #999;
    margin: 0;
}

/* ── Field Groups ────────────────────────────── */
.sha2w-field-group { margin-bottom: 18px; }
.sha2w-label {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    color: #555;
    margin-bottom: 7px;
    letter-spacing: .3px;
}
.sha2w-field-wrap {
    position: relative;
    display: flex;
    align-items: center;
}
.sha2w-field-icon {
    position: absolute;
    left: 14px;
    color: #bbb;
    display: flex;
    align-items: center;
    pointer-events: none;
    font-size: 13px;
    transition: color .2s;
    z-index: 1;
}
.sha2w-field-icon i,
.sha2w-field-icon svg { width: 15px; height: 15px; }

.sha2w-field-wrap:focus-within .sha2w-field-icon { color: #6c63ff; }

.sha2w-input {
    width: 100%;
    padding: 12px 42px 12px 42px;
    background: #f7f7fb;
    border: 1.5px solid #e2e2ec;
    border-radius: 10px;
    font-size: 14px;
    color: #333;
    outline: none;
    transition: border-color .2s, box-shadow .2s, background .2s;
    -webkit-appearance: none;
}
.sha2w-input:focus {
    border-color: #6c63ff;
    background: #fff;
    box-shadow: 0 0 0 3.5px rgba(108,99,255,.12);
}
.sha2w-input::placeholder { color: #bbb; }

/* No left icon case */
.sha2w-field-wrap:not(:has(.sha2w-field-icon)) .sha2w-input { padding-left: 14px; }

/* Eye toggle */
.sha2w-eye-btn {
    position: absolute;
    right: 13px;
    background: none;
    border: none;
    cursor: pointer;
    color: #bbb;
    display: flex;
    align-items: center;
    padding: 0;
    transition: color .18s;
}
.sha2w-eye-btn:hover { color: #6c63ff; }

/* Password strength */
.sha2w-strength-bar {
    height: 3px;
    background: #eee;
    border-radius: 10px;
    margin-top: 8px;
    overflow: hidden;
}
.sha2w-strength-fill {
    height: 100%;
    width: 0;
    border-radius: 10px;
    transition: width .35s, background .35s;
}
.sha2w-strength-label {
    font-size: 11px;
    font-weight: 600;
    display: block;
    margin-top: 4px;
    letter-spacing: .3px;
}

/* ── Row: remember + forgot ──────────────────── */
.sha2w-row-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    margin-top: -4px;
}
.sha2w-remember {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    color: #666;
    cursor: pointer;
    user-select: none;
}
.sha2w-remember input[type=checkbox] {
    width: 16px;
    height: 16px;
    accent-color: #6c63ff;
    cursor: pointer;
}

/* ── Links ───────────────────────────────────── */
.sha2w-link {
    background: none;
    border: none;
    color: #6c63ff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    transition: color .18s, text-decoration .18s;
}
.sha2w-link:hover { color: #574fd6; text-decoration: underline; }

/* ── Message ─────────────────────────────────── */
.sha2w-msg {
    font-size: 13px;
    padding: 0;
    border-radius: 8px;
    margin-bottom: 0;
    min-height: 0;
    transition: all .2s;
}
.sha2w-msg:not(:empty) { padding: 10px 14px; margin-bottom: 14px; }
.sha2w-msg.error   { background: #fff2f2; color: #d63031; border: 1px solid #ffcdd2; }
.sha2w-msg.success { background: #f0fff4; color: #00b894; border: 1px solid #b2dfdb; }

/* ── Submit Button ───────────────────────────── */
.sha2w-submit-btn {
    width: 100%;
    padding: 13px;
    background: #6c63ff;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: background .22s, box-shadow .22s, transform .15s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    letter-spacing: .3px;
    position: relative;
}
.sha2w-submit-btn:hover:not(:disabled) {
    background: #574fd6;
    box-shadow: 0 6px 22px rgba(108,99,255,.38);
    transform: translateY(-1px);
}
.sha2w-submit-btn:active:not(:disabled) { transform: translateY(0); }
.sha2w-submit-btn:disabled { opacity: .7; cursor: not-allowed; transform: none; }

/* Spinner */
.sha2w-spinner {
    width: 17px;
    height: 17px;
    border: 2.5px solid rgba(255,255,255,.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: sha2wSpin .75s linear infinite;
    display: none;
}
.sha2w-submit-btn.loading .sha2w-spinner { display: block; }
.sha2w-submit-btn.loading .sha2w-btn-text { opacity: .7; }

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

/* ── Switch text ─────────────────────────────── */
.sha2w-switch-text {
    text-align: center;
    font-size: 13px;
    color: #999;
    margin: 20px 0 0;
}

/* ── Divider ─────────────────────────────────── */
.sha2w-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0;
    color: #ccc;
    font-size: 12px;
}
.sha2w-divider::before,
.sha2w-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #eee;
}

/* ── Social ──────────────────────────────────── */
.sha2w-social-row { display: flex; gap: 10px; margin-bottom: 4px; }
.sha2w-social-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px;
    border: 1.5px solid #e8e8f0;
    border-radius: 9px;
    background: #fff;
    font-size: 13.5px;
    font-weight: 600;
    color: #444;
    cursor: pointer;
    transition: border-color .18s, background .18s, box-shadow .18s;
}
.sha2w-social-btn:hover { border-color: #6c63ff; background: #fafafe; box-shadow: 0 2px 10px rgba(108,99,255,.1); }

/* ── Forgot / Back ───────────────────────────── */
.sha2w-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: none;
    border: none;
    color: #888;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    margin-bottom: 20px;
    transition: color .18s;
}
.sha2w-back-btn:hover { color: #6c63ff; }

/* ── Responsive ──────────────────────────────── */
@media (max-width: 500px) {
    .sha2w-panel { padding: 22px 20px 26px; }
    .sha2w-form-title { font-size: 19px; }
    .sha2w-popup-box { border-radius: 16px; }
    .sha2w-tabs { padding: 0 16px; }
}

/* ── Reduced motion ──────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    .sha2w-overlay, .sha2w-popup-box, .sha2w-trigger-btn,
    .sha2w-input, .sha2w-submit-btn { transition: none; }
    .sha2w-spinner { animation: none; }
}
