/* ============================================
   RIDOPAY — PIN System Styles
   Setup PIN + Lock Screen
   ============================================ */

/* === PIN Overlay (Full Screen Lock) === */
.pin-overlay {
    position: fixed;
    inset: 0;
    background: var(--bg-deep, #0a0a0c);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 24px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.pin-overlay.show {
    opacity: 1;
    visibility: visible;
}

.pin-overlay.hiding {
    opacity: 0;
    transition: opacity 0.4s ease;
}

/* === PIN Content Wrapper === */
.pin-content {
    width: 100%;
    max-width: 340px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    animation: pinFadeIn 0.4s ease;
}

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

/* === PIN Logo === */
.pin-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.pin-logo-img {
    width: 56px;
    height: 56px;
    object-fit: contain;
    border-radius: 14px;
}

.pin-logo-text {
    font-family: var(--font-display, 'Playfair Display', serif);
    font-size: 24px;
    font-weight: 700;
    color: var(--gold, #c9a84c);
    letter-spacing: 4px;
}

/* === PIN Header === */
.pin-header {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.pin-icon-wrap {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(201, 168, 76, 0.08);
    border: 1px solid rgba(201, 168, 76, 0.15);
    border-radius: 18px;
    margin-bottom: 4px;
}

.pin-title {
    font-family: var(--font-display, 'Playfair Display', serif);
    font-size: 20px;
    font-weight: 700;
    color: var(--gold, #c9a84c);
    letter-spacing: 0.5px;
}

.pin-desc {
    font-size: 13px;
    color: var(--text-secondary, #9a978e);
    line-height: 1.5;
    max-width: 280px;
}

/* === PIN Dots (Lock Screen) === */
.pin-dots {
    display: flex;
    gap: 14px;
    margin: 8px 0;
}

.pin-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid rgba(201, 168, 76, 0.3);
    background: transparent;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.pin-dot.filled {
    background: var(--gold, #c9a84c);
    border-color: var(--gold, #c9a84c);
    transform: scale(1.1);
}

.pin-dot.error {
    border-color: var(--red, #e74c3c);
    background: var(--red, #e74c3c);
    animation: pinDotShake 0.4s ease;
}

@keyframes pinDotShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-6px); }
    75% { transform: translateX(6px); }
}

/* === PIN Input Boxes (Setup) === */
.pin-inputs {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.pin-box {
    width: 52px;
    height: 60px;
    text-align: center;
    font-size: 24px;
    font-weight: 700;
    font-family: var(--font-main, 'Outfit', sans-serif);
    color: var(--gold, #c9a84c);
    background: var(--bg-card, #13131a);
    border: 1.5px solid var(--border-card, rgba(201, 168, 76, 0.12));
    border-radius: 12px;
    outline: none;
    -webkit-text-security: disc;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    caret-color: var(--gold, #c9a84c);
}

.pin-box:focus {
    border-color: var(--gold, #c9a84c);
    box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.12);
}

.pin-box.filled {
    border-color: rgba(201, 168, 76, 0.4);
}

.pin-box.error {
    border-color: var(--red, #e74c3c);
    animation: pinDotShake 0.3s ease;
}

/* === PIN Numpad (Lock Screen) === */
.pin-numpad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    width: 100%;
    max-width: 280px;
    margin-top: 8px;
}

.numpad-btn {
    width: 100%;
    aspect-ratio: 1.6;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--bg-card, #13131a);
    border: 1px solid var(--border-card, rgba(201, 168, 76, 0.12));
    border-radius: 14px;
    cursor: pointer;
    font-family: var(--font-main, 'Outfit', sans-serif);
    color: var(--text-primary, #f0eee6);
    transition: background 0.1s ease, transform 0.1s ease;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.numpad-btn:active {
    background: rgba(201, 168, 76, 0.1);
    transform: scale(0.95);
}

.numpad-num {
    font-size: 24px;
    font-weight: 600;
    line-height: 1;
}

.numpad-sub {
    font-size: 9px;
    color: var(--text-muted, #5a584f);
    letter-spacing: 2px;
    margin-top: 2px;
}

.numpad-btn.empty {
    background: transparent;
    border-color: transparent;
    cursor: default;
}

.numpad-btn.delete {
    background: transparent;
    border-color: transparent;
}

.numpad-btn.delete:active {
    background: rgba(231, 76, 60, 0.08);
}

/* === PIN Action Buttons === */
.pin-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.pin-btn-primary {
    width: 100%;
    height: 50px;
    background: var(--gold, #c9a84c);
    color: #0a0a0c;
    border: none;
    border-radius: 14px;
    font-family: var(--font-main, 'Outfit', sans-serif);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: opacity 0.15s ease, transform 0.1s ease;
}

.pin-btn-primary:active {
    opacity: 0.85;
    transform: scale(0.98);
}

.pin-btn-primary:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pin-btn-skip {
    width: 100%;
    height: 44px;
    background: transparent;
    color: var(--text-muted, #5a584f);
    border: 1px solid var(--border-card, rgba(201, 168, 76, 0.12));
    border-radius: 14px;
    font-family: var(--font-main, 'Outfit', sans-serif);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.15s ease, border-color 0.15s ease;
}

.pin-btn-skip:active {
    color: var(--text-secondary, #9a978e);
    border-color: rgba(201, 168, 76, 0.25);
}

/* === PIN Error Text === */
.pin-error {
    font-size: 12px;
    color: var(--red, #e74c3c);
    min-height: 18px;
    text-align: center;
    font-weight: 500;
}

/* === PIN Step Indicator === */
.pin-step-indicator {
    display: flex;
    gap: 6px;
    margin-bottom: 4px;
}

.pin-step-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--border-card, rgba(201, 168, 76, 0.12));
    transition: background 0.2s ease;
}

.pin-step-dot.active {
    background: var(--gold, #c9a84c);
}

/* === Lockout Screen === */
.pin-icon-locked {
    background: rgba(231, 76, 60, 0.08) !important;
    border-color: rgba(231, 76, 60, 0.2) !important;
}

.pin-title-locked {
    color: var(--red, #e74c3c) !important;
}

.pin-lockout-timer {
    text-align: center;
    padding: 20px 24px;
    background: var(--bg-card, #13131a);
    border: 1px solid rgba(231, 76, 60, 0.15);
    border-radius: 16px;
    width: 100%;
}

.lockout-label {
    font-size: 12px;
    color: var(--text-muted, #5a584f);
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}

.lockout-countdown {
    font-family: var(--font-main, 'Outfit', sans-serif);
    font-size: 32px;
    font-weight: 700;
    color: var(--red, #e74c3c);
    letter-spacing: 2px;
}

/* === Attempts Info (Lock Screen) === */
.pin-attempts-info {
    font-size: 11px;
    color: var(--text-muted, #5a584f);
    text-align: center;
    min-height: 16px;
    transition: color 0.2s ease;
}

.pin-attempts-info strong {
    color: var(--text-secondary, #9a978e);
    font-weight: 600;
}

.pin-attempts-info.warning {
    color: var(--red, #e74c3c);
}

.pin-attempts-info.warning strong {
    color: var(--red, #e74c3c);
}

/* === Settings Section (Setup Step 3) === */
.pin-settings-section {
    width: 100%;
    animation: pinFadeIn 0.3s ease;
}

.pin-setting-card {
    background: var(--bg-card, #13131a);
    border: 1px solid var(--border-card, rgba(201, 168, 76, 0.12));
    border-radius: 16px;
    padding: 20px;
}

.setting-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary, #f0eee6);
    margin-bottom: 8px;
}

.setting-desc {
    font-size: 12px;
    color: var(--text-muted, #5a584f);
    line-height: 1.5;
    margin-bottom: 16px;
}

.attempts-selector {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.attempts-btn {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(201, 168, 76, 0.08);
    border: 1px solid rgba(201, 168, 76, 0.2);
    border-radius: 12px;
    cursor: pointer;
    color: var(--gold, #c9a84c);
    transition: background 0.15s ease, transform 0.1s ease;
}

.attempts-btn:active {
    background: rgba(201, 168, 76, 0.15);
    transform: scale(0.92);
}

.attempts-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 60px;
}

.attempts-value {
    font-size: 36px;
    font-weight: 700;
    color: var(--gold, #c9a84c);
    line-height: 1;
    font-family: var(--font-main, 'Outfit', sans-serif);
}

.attempts-label {
    font-size: 11px;
    color: var(--text-muted, #5a584f);
    margin-top: 2px;
}

.attempts-range {
    display: flex;
    justify-content: space-between;
    margin-top: 12px;
    font-size: 10px;
    color: var(--text-muted, #5a584f);
}
