/**
 * StockPulse — Frontend Styles
 */

/* ========================================
   Form Wrapper
   ======================================== */

.sp-notify-form-wrapper {
    margin: 15px 0;
    padding: 0;
    box-sizing: border-box;
}

.sp-notify-form-inner {
    background-color: #fafafa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
}

/* ========================================
   Heading
   ======================================== */

.sp-notify-heading {
    margin: 0 0 8px;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.4;
}

/* ========================================
   Label
   ======================================== */

.sp-notify-label {
    margin: 0 0 12px;
    font-size: 14px;
    color: #333;
    line-height: 1.6;
}

/* ========================================
   Form Row
   ======================================== */

.sp-form-row {
    display: flex;
    gap: 10px;
    align-items: stretch;
    flex-wrap: wrap;
}

/* ========================================
   Phone Input
   ======================================== */

.sp-phone-input {
    flex: 1;
    min-width: 180px;
    padding: 10px 14px;
    font-size: 15px;
    border: 1px solid #ccc;
    border-radius: 6px;
    outline: none;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    direction: ltr;
    text-align: left;
    box-sizing: border-box;
}

.sp-phone-input:focus {
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.15);
}

.sp-phone-input.sp-input-error {
    border-color: #dc3545;
    box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.15);
}

.sp-phone-input.sp-input-success {
    border-color: #28a745;
    box-shadow: 0 0 0 2px rgba(40, 167, 69, 0.15);
}

/* ========================================
   Submit Button
   ======================================== */

.sp-submit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    background-color: #0073aa;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.1s ease, opacity 0.3s ease;
    white-space: nowrap;
    min-width: 140px;
    box-sizing: border-box;
}

.sp-submit-btn:hover {
    opacity: 0.85;
}

.sp-submit-btn:active {
    transform: scale(0.98);
}

.sp-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.sp-btn-text {
    display: inline;
}

.sp-btn-loading {
    display: none;
}

.sp-submit-btn.sp-loading .sp-btn-text {
    display: none;
}

.sp-submit-btn.sp-loading .sp-btn-loading {
    display: inline-flex;
    align-items: center;
}

/* ========================================
   Spinner
   ======================================== */

.sp-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: sp-spin 0.6s linear infinite;
}

.sp-spinner-small {
    width: 14px;
    height: 14px;
    border-width: 2px;
    border-color: rgba(0, 0, 0, 0.3);
    border-top-color: #333;
}

@keyframes sp-spin {
    to {
        transform: rotate(360deg);
    }
}

/* ========================================
   Form Message
   ======================================== */

.sp-form-message {
    margin-top: 12px;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 13px;
    line-height: 1.5;
}

.sp-form-message.sp-msg-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.sp-form-message.sp-msg-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* ========================================
   Already Subscribed State
   ======================================== */

.sp-already-subscribed-box {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 14px 16px;
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 6px;
}

.sp-already-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    min-width: 24px;
    background-color: #28a745;
    color: #fff;
    border-radius: 50%;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    margin-top: 2px;
}

.sp-already-content {
    flex: 1;
}

.sp-already-subscribed-text {
    margin: 0 0 10px;
    font-size: 14px;
    line-height: 1.6;
    color: #155724;
}

/* ========================================
   Unsubscribe Button
   ======================================== */

.sp-unsubscribe-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 16px;
    font-size: 13px;
    font-weight: 500;
    color: #721c24;
    background-color: transparent;
    border: 1px solid #f5c6cb;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.3s ease, color 0.3s ease;
    white-space: nowrap;
    gap: 6px;
}

.sp-unsubscribe-btn:hover {
    background-color: #f8d7da;
    color: #491217;
    border-color: #e4b0b6;
}

.sp-unsubscribe-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.sp-unsub-text {
    display: inline;
}

.sp-unsub-loading {
    display: none;
    align-items: center;
}

/* ========================================
   Unsubscribe Message
   ======================================== */

.sp-unsub-message {
    margin-top: 10px;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    line-height: 1.5;
}

.sp-unsub-message.sp-msg-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.sp-unsub-message.sp-msg-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* ========================================
   Transition
   ======================================== */

.sp-form-container,
.sp-already-subscribed {
    transition: opacity 0.3s ease;
}

/* ========================================
   Responsive
   ======================================== */

@media screen and (max-width: 480px) {
    .sp-form-row {
        flex-direction: column;
    }

    .sp-phone-input {
        width: 100%;
        min-width: unset;
    }

    .sp-submit-btn {
        width: 100%;
        min-width: unset;
    }
}

/* ========================================
   RTL Support
   ======================================== */

html[dir="rtl"] .sp-notify-form-inner {
    font-family: Tahoma, Arial, sans-serif;
}

html[dir="rtl"] .sp-notify-heading {
    text-align: right;
}

html[dir="rtl"] .sp-notify-label {
    text-align: right;
}

html[dir="rtl"] .sp-phone-input {
    direction: ltr;
    text-align: left;
}

html[dir="rtl"] .sp-form-message {
    text-align: right;
}

html[dir="rtl"] .sp-form-row {
    flex-direction: row-reverse;
}

html[dir="rtl"] .sp-already-subscribed-box {
    flex-direction: row-reverse;
}

html[dir="rtl"] .sp-already-subscribed-text {
    text-align: right;
}

html[dir="rtl"] .sp-unsub-message {
    text-align: right;
}

@media screen and (max-width: 480px) {
    html[dir="rtl"] .sp-form-row {
        flex-direction: column;
    }
}


