/* ============================================================
   WC OTP Login – Frontend Styles
   ============================================================ */

:root {
    --otp-primary:    #6c47ff;
    --otp-primary-h:  #5538d4;
    --otp-surface:    #ffffff;
    --otp-border:     #e2e4e7;
    --otp-text:       #1a1a2e;
    --otp-muted:      #6b7280;
    --otp-error:      #dc2626;
    --otp-success:    #059669;
    --otp-radius:     10px;
    --otp-shadow:     0 4px 24px rgba(0,0,0,.08);
}

/* Wrapper */
.wc-otp-wrapper {
    max-width: 400px;
    margin: 0 auto;
    background: var(--otp-surface);
    border: 1px solid var(--otp-border);
    border-radius: var(--otp-radius);
    padding: 32px 28px;
    box-shadow: var(--otp-shadow);
    position: relative;
    font-family: inherit;
}

.wc-otp-title {
    margin: 0 0 20px;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--otp-text);
    text-align: center;
}

/* Steps */
.wc-otp-step { }
.wc-otp-hidden { display: none !important; }

/* Field group */
.wc-otp-field-group {
    margin-bottom: 14px;
}

/* Inputs */
.wc-otp-input {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid var(--otp-border);
    border-radius: var(--otp-radius);
    font-size: 1rem;
    color: var(--otp-text);
    background: #fafafa;
    transition: border-color .2s, box-shadow .2s;
    box-sizing: border-box;
    outline: none;
}

.wc-otp-input:focus {
    border-color: var(--otp-primary);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(108,71,255,.12);
}

.wc-otp-input[readonly] {
    opacity: .7;
    cursor: not-allowed;
}

/* OTP code input */
.wc-otp-code-input {
    font-size: 1.5rem;
    letter-spacing: .4em;
    text-align: center;
    font-weight: 700;
}

/* Primary button */
.wc-otp-btn {
    display: block;
    width: 100%;
    padding: 13px;
    border: none;
    border-radius: var(--otp-radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s, transform .1s;
    text-align: center;
}

.wc-otp-btn-primary {
    background: var(--otp-primary);
    color: #fff;
}

.wc-otp-btn-primary:hover:not(:disabled) {
    background: var(--otp-primary-h);
    transform: translateY(-1px);
}

.wc-otp-btn:disabled {
    opacity: .6;
    cursor: not-allowed;
    transform: none;
}

.wc-otp-full-width { width: 100%; }

/* Link button */
.wc-otp-link {
    background: none;
    border: none;
    color: var(--otp-primary);
    cursor: pointer;
    font-size: .875rem;
    text-decoration: underline;
    padding: 0;
}

.wc-otp-link:disabled {
    color: var(--otp-muted);
    text-decoration: none;
    cursor: default;
}

/* Hint line */
.wc-otp-hint {
    font-size: .9rem;
    color: var(--otp-muted);
    margin: 0 0 16px;
    text-align: center;
}

/* Resend area */
.wc-otp-resend-wrap {
    margin-top: 12px;
    text-align: center;
    font-size: .875rem;
    color: var(--otp-muted);
}

#wc-otp-countdown {
    margin-left: 4px;
    font-weight: 600;
}

/* Message feedback */
.wc-otp-message {
    margin-top: 10px;
    padding: 10px 14px;
    border-radius: 7px;
    font-size: .875rem;
    text-align: center;
    display: none;
}

.wc-otp-message.wc-otp-error {
    display: block;
    background: #fef2f2;
    color: var(--otp-error);
    border: 1px solid #fecaca;
}

.wc-otp-message.wc-otp-success {
    display: block;
    background: #ecfdf5;
    color: var(--otp-success);
    border: 1px solid #a7f3d0;
}

/* Logged-in message */
.wc-otp-logged-in {
    color: var(--otp-muted);
    font-size: .95rem;
}

/* Spinner */
.wc-otp-loading {
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,.75);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--otp-radius);
    z-index: 10;
}

.wc-otp-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--otp-border);
    border-top-color: var(--otp-primary);
    border-radius: 50%;
    animation: wc-otp-spin .7s linear infinite;
}

@keyframes wc-otp-spin { to { transform: rotate(360deg); } }

/* ── Profile Popup Overlay ───────────────────────────── */
.wc-otp-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.55);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: wc-otp-fade .25s ease;
}

@keyframes wc-otp-fade { from { opacity: 0; } to { opacity: 1; } }

.wc-otp-popup {
    background: #fff;
    border-radius: 14px;
    padding: 32px 28px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,.2);
    animation: wc-otp-slide .3s ease;
}

@keyframes wc-otp-slide {
    from { opacity: 0; transform: translateY(30px); }
    to   { opacity: 1; transform: translateY(0); }
}

.wc-otp-popup-title {
    margin: 0 0 4px;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--otp-text);
}

.wc-otp-popup-sub {
    color: var(--otp-muted);
    margin: 0 0 20px;
    font-size: .9rem;
}

/* Form grid inside popup */
.wc-otp-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}

.wc-otp-form-group { display: flex; flex-direction: column; gap: 5px; }
.wc-otp-form-group label { font-size: .8rem; font-weight: 600; color: var(--otp-muted); text-transform: uppercase; letter-spacing: .04em; }
.wc-otp-full-width { grid-column: 1 / -1; }

/* Skip link */
.wc-otp-skip {
    display: block;
    text-align: center;
    margin-top: 12px;
    color: var(--otp-muted);
    font-size: .85rem;
}

/* ── Responsive ─────────────────────────────────────── */
@media (max-width: 480px) {
    .wc-otp-wrapper { padding: 24px 18px; }
    .wc-otp-form-grid { grid-template-columns: 1fr; }
    .wc-otp-popup { padding: 24px 18px; }
}
