/* SMS Login Plugin - Frontend Styles */
:root {
    --sms-primary: #1a73e8;
    --sms-primary-dark: #1557b0;
    --sms-success: #0f9d58;
    --sms-error: #d93025;
    --sms-border: #dadce0;
    --sms-bg: #fff;
    --sms-text: #202124;
    --sms-text-muted: #5f6368;
    --sms-radius: 12px;
    --sms-shadow: 0 2px 16px rgba(0,0,0,.12);
}

.sms-login-wrapper {
    max-width: 420px;
    margin: 0 auto 24px;
    background: var(--sms-bg);
    border-radius: var(--sms-radius);
    box-shadow: var(--sms-shadow);
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Tabs */
.sms-login-tabs {
    display: flex;
    border-bottom: 1px solid var(--sms-border);
    background: #f8f9fa;
}

.sms-login-tab {
    flex: 1;
    padding: 14px 8px;
    border: none;
    background: transparent;
    font-size: 14px;
    font-weight: 500;
    color: var(--sms-text-muted);
    cursor: pointer;
    transition: all .2s;
    border-bottom: 3px solid transparent;
}

.sms-login-tab.active {
    color: var(--sms-primary);
    border-bottom-color: var(--sms-primary);
    background: var(--sms-bg);
}

.sms-login-tab:hover:not(.active) {
    background: #f1f3f4;
    color: var(--sms-text);
}

/* Panels */
.sms-login-panel {
    display: none;
    padding: 24px;
}

.sms-login-panel.active {
    display: block;
}

/* Steps */
.sms-login-step { animation: fadeIn .2s ease; }

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

/* Fields */
.sms-login-field {
    margin-bottom: 20px;
}

.sms-login-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--sms-text);
    margin-bottom: 8px;
    letter-spacing: .01em;
}

/* Phone input */
.sms-phone-input-wrap {
    display: flex;
    align-items: center;
    border: 2px solid var(--sms-border);
    border-radius: 10px;
    overflow: hidden;
    transition: border-color .2s;
}

.sms-phone-input-wrap:focus-within {
    border-color: var(--sms-primary);
    box-shadow: 0 0 0 3px rgba(26,115,232,.15);
}

.sms-flag-prefix {
    padding: 12px 14px;
    background: #f8f9fa;
    font-size: 14px;
    color: var(--sms-text-muted);
    border-right: 1px solid var(--sms-border);
    white-space: nowrap;
    user-select: none;
}

.sms-phone-input-wrap input {
    flex: 1;
    border: none !important;
    outline: none !important;
    padding: 12px 14px !important;
    font-size: 18px !important;
    letter-spacing: .06em;
    color: var(--sms-text);
    background: transparent;
    box-shadow: none !important;
    min-width: 0;
}

.sms-hint {
    font-size: 12px;
    color: var(--sms-text-muted);
    margin: 6px 0 0;
}

/* OTP Inputs */
.sms-otp-inputs {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin: 4px 0;
}

.sms-otp-digit {
    width: 50px !important;
    height: 58px !important;
    text-align: center;
    font-size: 24px !important;
    font-weight: 700;
    border: 2px solid var(--sms-border) !important;
    border-radius: 10px !important;
    padding: 0 !important;
    transition: all .2s;
    color: var(--sms-text);
    background: #fff;
    outline: none;
    box-shadow: none !important;
}

.sms-otp-digit:focus {
    border-color: var(--sms-primary) !important;
    box-shadow: 0 0 0 3px rgba(26,115,232,.15) !important;
    transform: translateY(-2px);
}

.sms-otp-digit:not(:placeholder-shown) {
    background: #e8f0fe;
    border-color: var(--sms-primary) !important;
    color: var(--sms-primary);
}

/* OTP Info */
.sms-otp-info {
    text-align: center;
    padding: 16px;
    background: #e8f5e9;
    border-radius: 10px;
    margin-bottom: 20px;
}

.sms-otp-icon { font-size: 28px; display: block; margin-bottom: 6px; }
.sms-otp-info p { margin: 0 0 4px; font-size: 14px; color: var(--sms-text); }
.sms-otp-info strong { font-size: 16px; color: var(--sms-success); letter-spacing: .06em; }

/* Buttons */
.sms-login-btn {
    display: block;
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s;
    letter-spacing: .01em;
    text-align: center;
}

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

.sms-btn-primary:hover:not(:disabled) {
    background: var(--sms-primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(26,115,232,.3);
}

.sms-btn-primary:disabled {
    background: #b0bec5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.sms-btn-primary.sms-btn-ready {
    background: var(--sms-success);
    animation: pulse .4s ease;
}

@keyframes pulse {
    0%  { transform: scale(1); }
    50% { transform: scale(1.03); }
    100%{ transform: scale(1); }
}

.sms-resend-wrap {
    display: flex;
    justify-content: space-between;
    margin-top: 14px;
}

.sms-btn-link {
    background: none;
    color: var(--sms-primary);
    font-size: 13px;
    padding: 6px 4px;
    width: auto;
    text-decoration: underline;
}

.sms-btn-link:hover:not(:disabled) {
    color: var(--sms-primary-dark);
    background: none;
    transform: none;
    box-shadow: none;
}

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

/* Messages */
.sms-login-message {
    margin-top: 12px;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    min-height: 0;
    transition: all .2s;
}

.sms-login-message:empty { display: none; }

.sms-msg-success {
    background: #e6f4ea;
    color: #137333;
    border-left: 3px solid var(--sms-success);
}

.sms-msg-error {
    background: #fce8e6;
    color: #c5221f;
    border-left: 3px solid var(--sms-error);
}

/* WooCommerce Separator */
.sms-login-separator {
    text-align: center;
    margin: 20px 0;
    position: relative;
}

.sms-login-separator::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--sms-border);
}

.sms-login-separator span {
    position: relative;
    background: #fff;
    padding: 0 12px;
    color: var(--sms-text-muted);
    font-size: 13px;
}

/* Legacy note */
.sms-legacy-note {
    color: var(--sms-text-muted);
    font-size: 14px;
    text-align: center;
    padding: 8px 0;
}

/* WooCommerce Checkout */
.sms-login-checkout-wrapper {
    margin-bottom: 24px;
    border-radius: var(--sms-radius);
    overflow: hidden;
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
    :root {
        --sms-bg: #1e1e1e;
        --sms-text: #e8eaed;
        --sms-text-muted: #9aa0a6;
        --sms-border: #3c4043;
    }

    .sms-login-tabs { background: #2d2d2d; }
    .sms-flag-prefix { background: #2d2d2d; }
    .sms-otp-digit { background: #1e1e1e; color: #e8eaed; }
    .sms-otp-info { background: #1e3a2f; }
    .sms-login-separator span { background: #1e1e1e; }
    .sms-otp-digit:not(:placeholder-shown) { background: #1a2b4a; }
}

/* Mobile */
@media (max-width: 480px) {
    .sms-login-wrapper { border-radius: 0; margin: 0 -12px 24px; }
    .sms-otp-digit { width: 42px !important; height: 50px !important; font-size: 20px !important; }
    .sms-otp-inputs { gap: 5px; }
}
