/* Phone OTP Login — Frontend Styles */
/* Karthick Sweets & Snacks Theme (Green + Gold) */

/* ------------------------------------------------
   CSS Custom Properties (Defaults)
------------------------------------------------ */
:root {
    --phone-otp-btn-bg: #2FA769;
    --phone-otp-btn-text: #FFFFFF;
    --phone-otp-btn-hover: #248B56;
    --phone-otp-btn-radius: 8px;
    --phone-otp-card-bg: #FFFFFF;
    --phone-otp-card-radius: 14px;
    --phone-otp-card-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
    --phone-otp-accent: #2FA769;
    /* Split Layout - Beige Theme */
    --phone-otp-bg-beige: #FDF8F3;
    --phone-otp-bg-beige-dark: #F5EDE5;
    --phone-otp-text-warm: #4A4039;
}

/* ------------------------------------------------
   Hide default WooCommerce login/register forms
   (non-destructive: reappears if plugin deactivated)
------------------------------------------------ */
.woocommerce-account .woocommerce-form-login,
.woocommerce-account .woocommerce-form-register,
.woocommerce-account .u-columns {
    display: none !important;
}

/* ------------------------------------------------
   Split Layout - Shop Banner V1 Style
------------------------------------------------ */
.phone-otp-layout-split {
    display: flex;
    min-height: 100vh;
    padding: 0;
    background: var(--phone-otp-form-bg, var(--phone-otp-bg-beige));
}

/* Left banner - uses CSS custom property for width */
.phone-otp-split-banner {
    flex: 0 0 var(--phone-otp-banner-width, 50%);
    position: relative;
    overflow: hidden;
    background: var(--phone-otp-bg-beige-dark);
}

.phone-otp-split-banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

/* Right form area - uses CSS custom property for width */
.phone-otp-split-form {
    flex: 0 0 var(--phone-otp-form-width, 50%);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--phone-otp-form-bg, var(--phone-otp-bg-beige));
    padding: 40px;
    box-sizing: border-box;
}

/* Card in split mode */
.phone-otp-layout-split .phone-otp-login-card {
    max-width: 400px;
    width: 100%;
    background: #FFFFFF;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

.phone-otp-layout-split .phone-otp-login-card:hover {
    transform: none;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

/* Warm text color for split layout */
.phone-otp-layout-split .phone-otp-title {
    color: var(--phone-otp-text-warm);
}

.phone-otp-layout-split .phone-otp-subtitle {
    color: #6B5D52;
}

/* ------------------------------------------------
   Card wrapper
------------------------------------------------ */
.phone-otp-login-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px 16px;
    min-height: 400px;
    position: relative;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* Background image support */
.phone-otp-login-has-bg {
    min-height: 100vh;
    padding: 60px 20px;
}

.phone-otp-bg-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    pointer-events: none;
}

.phone-otp-login-has-bg .phone-otp-login-card {
    position: relative;
    z-index: 2;
}

/* ------------------------------------------------
   Modern card design
------------------------------------------------ */
.phone-otp-login-card {
    width: 100%;
    max-width: 420px;
    background: var(--phone-otp-card-bg);
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: var(--phone-otp-card-radius);
    box-shadow: var(--phone-otp-card-shadow);
    padding: 40px 36px;
    box-sizing: border-box;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.phone-otp-login-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}

/* Glassmorphism effect */
.phone-otp-login-card.phone-otp-glass {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* ------------------------------------------------
   Checkout variant
------------------------------------------------ */
.phone-otp-login-checkout .phone-otp-login-card {
    max-width: 100%;
    border: 1px solid #ddd;
    box-shadow: none;
    padding: 24px;
    border-radius: 8px;
}

.phone-otp-login-checkout .phone-otp-login-card:hover {
    transform: none;
    box-shadow: none;
}

/* ------------------------------------------------
   Typography
------------------------------------------------ */
.phone-otp-title {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 8px;
    text-align: center;
    color: #222;
    line-height: 1.3;
}

.phone-otp-subtitle {
    font-size: 15px;
    color: #666;
    text-align: center;
    margin: 0 0 28px;
    line-height: 1.5;
}

.phone-otp-subtitle strong {
    color: #333;
}

.phone-otp-helper-text {
    font-size: 13px;
    color: #888;
    text-align: center;
    margin: 16px 0 0;
    line-height: 1.4;
}

.phone-otp-phone-display {
    text-align: center;
    margin: 0 0 20px;
    font-size: 14px;
}

.phone-otp-change-phone {
    font-size: 13px;
    color: var(--phone-otp-accent);
    text-decoration: none;
    margin-left: 8px;
    font-weight: 500;
    transition: color 0.2s ease;
}

.phone-otp-change-phone:hover {
    color: var(--phone-otp-btn-hover);
    text-decoration: underline;
}

/* ------------------------------------------------
   Input group
------------------------------------------------ */
.phone-otp-field-group {
    margin-bottom: 20px;
}

.phone-otp-input-wrap {
    display: flex;
    align-items: stretch;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.phone-otp-input-wrap:focus-within {
    border-color: var(--phone-otp-accent);
    box-shadow: 0 0 0 3px rgba(47, 167, 105, 0.1);
}

.phone-otp-country-code {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--phone-otp-btn-bg);
    color: #fff;
    font-weight: 600;
    font-size: 15px;
    padding: 0 16px;
    white-space: nowrap;
    user-select: none;
    min-width: 60px;
}

.phone-otp-phone-input,
.phone-otp-otp-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 16px;
    padding: 16px 14px;
    background: transparent;
    letter-spacing: 1px;
    width: 100%;
    min-width: 0;
}

.phone-otp-phone-input::placeholder,
.phone-otp-otp-input::placeholder {
    color: #aaa;
    letter-spacing: 0.5px;
}

.phone-otp-input-wrap--otp {
    justify-content: center;
}

.phone-otp-otp-input {
    text-align: center;
    letter-spacing: 6px;
    font-size: 22px;
    font-weight: 600;
}

/* ------------------------------------------------
   Error message
------------------------------------------------ */
.phone-otp-error {
    background: #fef0f0;
    color: #c00;
    font-size: 13px;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    line-height: 1.4;
    border: 1px solid rgba(200, 0, 0, 0.1);
}

/* ------------------------------------------------
   Premium button
------------------------------------------------ */
.phone-otp-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 16px 24px;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.3px;
    color: var(--phone-otp-btn-text);
    background: var(--phone-otp-btn-bg);
    border: none;
    border-radius: var(--phone-otp-btn-radius);
    cursor: pointer;
    transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
    min-height: 52px;
    text-transform: none;
}

.phone-otp-btn:hover {
    background: var(--phone-otp-btn-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(47, 167, 105, 0.3);
}

.phone-otp-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(47, 167, 105, 0.2);
}

.phone-otp-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ------------------------------------------------
   Loading spinner
------------------------------------------------ */
.phone-otp-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: phone-otp-spin 0.6s linear infinite;
    margin-left: 10px;
}

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

/* ------------------------------------------------
   Resend area
------------------------------------------------ */
.phone-otp-resend-wrap {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
    color: #666;
}

.phone-otp-resend-timer {
    color: #888;
}

.phone-otp-resend-link {
    color: var(--phone-otp-accent);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.phone-otp-resend-link:hover {
    color: var(--phone-otp-btn-hover);
    text-decoration: underline;
}

/* ------------------------------------------------
   Checkout toggle
------------------------------------------------ */
.phone-otp-checkout-toggle {
    margin-bottom: 20px;
}

.phone-otp-checkout-toggle a {
    color: var(--phone-otp-accent);
    text-decoration: none;
    font-size: 14px;
}

.phone-otp-checkout-toggle a:hover {
    text-decoration: underline;
}

.phone-otp-checkout-form {
    display: none;
    margin-bottom: 24px;
}

.phone-otp-checkout-form.active {
    display: block;
}

/* ------------------------------------------------
   Dashboard phone display
------------------------------------------------ */
.phone-otp-dashboard-phone {
    background: #f8f8f8;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 20px;
    font-size: 15px;
}

.phone-otp-dashboard-phone strong {
    color: #333;
}

/* ------------------------------------------------
   Split Layout — Responsive (992px - Tablet)
------------------------------------------------ */
@media (max-width: 992px) {
    .phone-otp-layout-split {
        flex-direction: column;
    }

    .phone-otp-split-banner {
        flex: 0 0 40vh;
        min-height: 250px;
    }

    .phone-otp-split-form {
        flex: 1;
        padding: 40px 20px;
    }

    .phone-otp-layout-split .phone-otp-login-card {
        max-width: 100%;
    }
}

/* ------------------------------------------------
   Split Layout — Responsive (576px - Mobile)
------------------------------------------------ */
@media (max-width: 576px) {
    .phone-otp-split-banner {
        flex: 0 0 30vh;
        min-height: 200px;
    }

    .phone-otp-split-form {
        padding: 30px 16px;
    }
}

/* ------------------------------------------------
   Responsive — Tablet (768px)
------------------------------------------------ */
@media (max-width: 768px) {
    .phone-otp-login-wrap {
        padding: 30px 20px;
        width: 95%;
        margin: 0 auto;
    }

    /* Exclude split layout from these width/margin overrides */
    .phone-otp-login-wrap.phone-otp-layout-split {
        width: 100%;
        margin: 0;
    }

    .phone-otp-login-has-bg {
        min-height: auto;
        padding: 40px 16px;
    }

    .phone-otp-login-card {
        padding: 32px 28px;
        max-width: 100%;
    }

    .phone-otp-title {
        font-size: 22px;
    }

    .phone-otp-subtitle {
        font-size: 14px;
        margin-bottom: 24px;
    }
}

/* ------------------------------------------------
   Responsive — Mobile (480px)
------------------------------------------------ */
@media (max-width: 480px) {
    .phone-otp-login-wrap {
        padding: 20px 12px;
    }

    .phone-otp-login-card {
        padding: 28px 20px;
        border-radius: 12px;
    }

    .phone-otp-title {
        font-size: 20px;
    }

    .phone-otp-subtitle {
        font-size: 13px;
        margin-bottom: 20px;
    }

    .phone-otp-phone-input,
    .phone-otp-otp-input {
        font-size: 16px;
        padding: 14px 12px;
    }

    .phone-otp-otp-input {
        font-size: 20px;
        letter-spacing: 4px;
    }

    .phone-otp-btn {
        padding: 14px 20px;
        font-size: 14px;
        min-height: 48px;
    }

    .phone-otp-country-code {
        padding: 0 12px;
        font-size: 14px;
        min-width: 52px;
    }

    .phone-otp-helper-text {
        font-size: 12px;
    }
}

/* ------------------------------------------------
   Policy links styling
------------------------------------------------ */
.phone-otp-policy-link {
    color: var(--phone-otp-accent, #2FA769);
    font-weight: 600;
    text-decoration: underline;
    transition: color 0.2s ease;
}

.phone-otp-policy-link:hover {
    color: #248a55;
    text-decoration: none;
}
