/**
 * Digitly – Front-end Styles
 *
 * Mobile-first, clean design for login/register forms.
 *
 * @package Digitly
 * @since   1.0.0
 */

/* ═══════════════════════════════════════════════════════════
   Form Wrapper
   ═══════════════════════════════════════════════════════════ */
.digitly-form-wrapper {
    max-width: 420px;
    margin: 30px auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
}

.digitly-form {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 32px 28px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

.digitly-form-title {
    font-size: 22px;
    font-weight: 700;
    color: #1a202c;
    margin: 0 0 24px;
    text-align: center;
}

/* ═══════════════════════════════════════════════════════════
   Fields
   ═══════════════════════════════════════════════════════════ */
.digitly-field-group {
    margin-bottom: 18px;
}

.digitly-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 6px;
    letter-spacing: 0.02em;
}

.digitly-input {
    width: 100%;
    padding: 12px 14px;
    font-size: 15px;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    background: #f7fafc;
    color: #2d3748;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
    outline: none;
}

.digitly-input:focus {
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
    background: #fff;
}

select.digitly-input {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%234a5568' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

/* ═══════════════════════════════════════════════════════════
   OTP Digit Inputs
   ═══════════════════════════════════════════════════════════ */
.digitly-otp-inputs {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin: 20px 0;
}

.digitly-otp-digit {
    width: 48px !important;
    height: 54px;
    text-align: center;
    font-size: 22px;
    font-weight: 700;
    padding: 0;
    border-radius: 10px;
    letter-spacing: 0;
}

.digitly-otp-digit:focus {
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

/* ═══════════════════════════════════════════════════════════
   Buttons
   ═══════════════════════════════════════════════════════════ */
.digitly-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 13px 20px;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #4f46e5, #6366f1);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.1s;
    margin-top: 8px;
}

.digitly-btn:hover {
    opacity: 0.92;
}

.digitly-btn:active {
    transform: scale(0.98);
}

.digitly-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Spinner */
.digitly-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: digitly-spin 0.6s linear infinite;
}

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

/* ═══════════════════════════════════════════════════════════
   OTP Info & Resend
   ═══════════════════════════════════════════════════════════ */
.digitly-otp-info {
    text-align: center;
    font-size: 14px;
    color: #4a5568;
    margin-bottom: 8px;
}

.digitly-phone-display {
    font-weight: 600;
    color: #2d3748;
}

.digitly-change-phone {
    color: #4f46e5;
    text-decoration: none;
    font-size: 13px;
    margin-left: 4px;
}

.digitly-change-phone:hover {
    text-decoration: underline;
}

.digitly-resend-wrap {
    text-align: center;
    margin-top: 16px;
}

.digitly-btn-resend {
    background: none;
    border: none;
    color: #4f46e5;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 8px;
}

.digitly-btn-resend:disabled {
    color: #a0aec0;
    cursor: not-allowed;
}

.digitly-countdown {
    display: block;
    font-size: 13px;
    color: #718096;
    margin-top: 4px;
}

/* ═══════════════════════════════════════════════════════════
   Messages
   ═══════════════════════════════════════════════════════════ */
.digitly-message {
    margin-top: 16px;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    text-align: center;
}

.digitly-message.success {
    background: #f0fff4;
    color: #22543d;
    border: 1px solid #c6f6d5;
}

.digitly-message.error {
    background: #fff5f5;
    color: #9b2c2c;
    border: 1px solid #fed7d7;
}

/* ═══════════════════════════════════════════════════════════
   Popup / Modal
   ═══════════════════════════════════════════════════════════ */
.digitly-popup-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999999;
    justify-content: center;
    align-items: center;
}

.digitly-popup-overlay.active {
    display: flex;
}

.digitly-popup-content {
    position: relative;
    width: 90%;
    max-width: 440px;
    max-height: 90vh;
    overflow-y: auto;
}

.digitly-popup-close {
    position: absolute;
    top: 8px;
    right: 12px;
    background: none;
    border: none;
    font-size: 28px;
    color: #a0aec0;
    cursor: pointer;
    line-height: 1;
    z-index: 2;
}

.digitly-popup-close:hover {
    color: #4a5568;
}

/* ═══════════════════════════════════════════════════════════
   WooCommerce Integration
   ═══════════════════════════════════════════════════════════ */
.digitly-woo-otp-link {
    text-align: center;
    margin-top: 16px;
}

.digitly-woo-otp-link p {
    color: #718096;
    font-size: 13px;
    margin-bottom: 8px;
}

.digitly-checkout-notice {
    padding: 14px 20px;
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 20px;
}

.digitly-checkout-notice a {
    color: #4f46e5;
    font-weight: 600;
}

/* ═══════════════════════════════════════════════════════════
   Already Logged In
   ═══════════════════════════════════════════════════════════ */
.digitly-logged-in,
.digitly-disabled {
    text-align: center;
    padding: 20px;
    color: #4a5568;
    font-size: 14px;
}

/* ═══════════════════════════════════════════════════════════
   Responsive
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 480px) {
    .digitly-form {
        padding: 24px 20px;
        border-radius: 10px;
    }
    .digitly-otp-digit {
        width: 40px !important;
        height: 46px;
        font-size: 18px;
    }
    .digitly-otp-inputs {
        gap: 6px;
    }
}
