/**
 * POS Authentication Styles
 *
 * @package Anshuk_Helper
 * @since 1.0.0
 */

/* Auth Page Container */
.ansk-pos-auth-page {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    min-height: 100vh;
}

.ansk-pos-auth-container {
    max-width: 420px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Back Button */
.ansk-pos-auth-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #666;
    font-size: 14px;
    text-decoration: none;
    margin-bottom: 24px;
    transition: color 0.2s;
}

.ansk-pos-auth-back:hover {
    color: #333;
}

.ansk-pos-auth-back svg {
    width: 18px;
    height: 18px;
}

/* Logo */
.ansk-pos-auth-logo {
    text-align: center;
    margin-bottom: 32px;
}

.ansk-pos-auth-logo img {
    max-width: 160px;
    max-height: 60px;
    width: auto;
    height: auto;
}

.ansk-pos-auth-logo h1 {
    font-size: 24px;
    font-weight: 700;
    color: #333;
    margin: 0;
}

/* Auth Card */
.ansk-pos-auth-card {
    background: #fff;
    border-radius: 16px;
    padding: 32px 24px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
    flex: 1;
}

.ansk-pos-auth-header {
    text-align: center;
    margin-bottom: 28px;
}

.ansk-pos-auth-header h2 {
    font-size: 24px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 8px;
}

.ansk-pos-auth-header p {
    font-size: 14px;
    color: #666;
    margin: 0;
}

/* Error Message */
.ansk-pos-auth-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 20px;
    color: #dc2626;
    font-size: 14px;
}

/* Form Groups */
.ansk-pos-form-group {
    margin-bottom: 20px;
}

.ansk-pos-form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin-bottom: 8px;
}

.ansk-pos-form-group label .required {
    color: #dc2626;
}

.ansk-pos-input {
    width: 100%;
    padding: 14px 16px;
    font-size: 16px;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
    -webkit-appearance: none;
}

.ansk-pos-input:focus {
    border-color: #ff3f6c;
    box-shadow: 0 0 0 3px rgba(255, 63, 108, 0.1);
}

.ansk-pos-input::placeholder {
    color: #9ca3af;
}

/* Phone Input */
.ansk-pos-phone-input {
    display: flex;
    align-items: stretch;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.ansk-pos-phone-input:focus-within {
    border-color: #ff3f6c;
    box-shadow: 0 0 0 3px rgba(255, 63, 108, 0.1);
}

.ansk-pos-phone-prefix {
    display: flex;
    align-items: center;
    padding: 0 12px;
    background: #f9fafb;
    border-right: 1px solid #e5e7eb;
    font-size: 16px;
    font-weight: 500;
    color: #374151;
    white-space: nowrap;
}

.ansk-pos-phone-input .ansk-pos-input {
    border: none;
    border-radius: 0;
    flex: 1;
}

.ansk-pos-phone-input .ansk-pos-input:focus {
    box-shadow: none;
}

/* OTP Method Selection */
.ansk-pos-otp-method {
    margin-bottom: 24px;
}

.ansk-pos-method-options {
    display: flex;
    gap: 12px;
}

.ansk-pos-method-option {
    flex: 1;
    cursor: pointer;
}

.ansk-pos-method-option input {
    display: none;
}

.ansk-pos-method-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    transition: all 0.2s;
}

.ansk-pos-method-label svg {
    width: 20px;
    height: 20px;
}

.ansk-pos-method-label .whatsapp-icon {
    color: #25D366;
}

.ansk-pos-method-label .sms-icon {
    color: #3b82f6;
}

.ansk-pos-method-option input:checked + .ansk-pos-method-label {
    border-color: #ff3f6c;
    background: #fff5f7;
    color: #ff3f6c;
}

/* Buttons */
.ansk-pos-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.ansk-pos-btn-primary {
    background: #ff3f6c;
    color: #fff;
}

.ansk-pos-btn-primary:hover:not(:disabled) {
    background: #e63560;
}

.ansk-pos-btn-primary:disabled {
    background: #fecdd3;
    cursor: not-allowed;
}

.ansk-pos-btn-outline {
    background: #fff;
    color: #374151;
    border: 1.5px solid #e5e7eb;
}

.ansk-pos-btn-outline:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}

.ansk-pos-btn-outline svg {
    width: 18px;
    height: 18px;
}

/* Google Button */
.ansk-pos-btn-google {
    background: #fff;
    color: #374151;
    border: 1.5px solid #e5e7eb;
}

.ansk-pos-btn-google:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}

.ansk-pos-btn-google .google-icon {
    width: 20px;
    height: 20px;
}

/* Spinner */
.btn-loader {
    display: inline-flex;
}

.spinner {
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Divider */
.ansk-pos-auth-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 24px 0;
}

.ansk-pos-auth-divider::before,
.ansk-pos-auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e5e7eb;
}

.ansk-pos-auth-divider span {
    font-size: 13px;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Terms */
.ansk-pos-auth-terms {
    font-size: 12px;
    color: #9ca3af;
    text-align: center;
    margin-top: 24px;
    line-height: 1.5;
}

.ansk-pos-auth-terms a {
    color: #ff3f6c;
    text-decoration: none;
}

.ansk-pos-auth-terms a:hover {
    text-decoration: underline;
}

/* OTP Form */
.ansk-pos-otp-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.ansk-pos-back-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    background: #f3f4f6;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s;
}

.ansk-pos-back-btn:hover {
    background: #e5e7eb;
}

.ansk-pos-back-btn svg {
    width: 18px;
    height: 18px;
    color: #374151;
}

.ansk-pos-otp-info {
    flex: 1;
}

.ansk-pos-otp-sent-to {
    font-size: 14px;
    color: #666;
    margin: 0;
}

.ansk-pos-otp-sent-to strong {
    color: #1a1a1a;
}

.ansk-pos-change-number {
    background: none;
    border: none;
    color: #ff3f6c;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    padding: 0;
}

.ansk-pos-change-number:hover {
    text-decoration: underline;
}

/* OTP Inputs */
.ansk-pos-otp-inputs {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-bottom: 16px;
}

.ansk-pos-otp-digit {
    width: 48px;
    height: 56px;
    text-align: center;
    font-size: 24px;
    font-weight: 600;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
    -webkit-appearance: none;
}

.ansk-pos-otp-digit:focus {
    border-color: #ff3f6c;
    box-shadow: 0 0 0 3px rgba(255, 63, 108, 0.1);
}

.ansk-pos-otp-digit.filled {
    border-color: #10b981;
    background: #ecfdf5;
}

.ansk-pos-otp-digit.error {
    border-color: #dc2626;
    background: #fef2f2;
}

/* OTP Timer */
.ansk-pos-otp-timer {
    text-align: center;
    font-size: 13px;
    color: #666;
    margin-bottom: 20px;
}

#otp-countdown {
    font-weight: 600;
    color: #ff3f6c;
}

/* Resend OTP */
.ansk-pos-resend-otp {
    text-align: center;
    margin-top: 16px;
}

#resend-timer {
    font-size: 13px;
    color: #9ca3af;
}

.ansk-pos-resend-btn {
    background: none;
    border: none;
    color: #ff3f6c;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    padding: 0;
}

.ansk-pos-resend-btn:hover {
    text-decoration: underline;
}

.ansk-pos-resend-btn:disabled {
    color: #9ca3af;
    cursor: not-allowed;
}

/* User Menu (Header) */
.ansk-pos-user-menu {
    position: relative;
}

.ansk-pos-user-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 8px;
    transition: background 0.2s;
}

.ansk-pos-user-toggle:hover {
    background: rgba(0, 0, 0, 0.04);
}

.ansk-pos-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    background: #ff3f6c;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ansk-pos-user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ansk-pos-user-initials {
    font-size: 12px;
    font-weight: 600;
    color: #fff;
}

.ansk-pos-user-name {
    font-size: 14px;
    font-weight: 500;
    color: #1a1a1a;
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ansk-pos-user-chevron {
    width: 16px;
    height: 16px;
    color: #666;
    transition: transform 0.2s;
}

.ansk-pos-user-toggle[aria-expanded="true"] .ansk-pos-user-chevron {
    transform: rotate(180deg);
}

/* User Dropdown */
.ansk-pos-user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 280px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.2s, visibility 0.2s, transform 0.2s;
    z-index: 1000;
}

.ansk-pos-user-toggle[aria-expanded="true"] + .ansk-pos-user-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.ansk-pos-user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border-bottom: 1px solid #f3f4f6;
}

.ansk-pos-user-avatar-lg {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    background: #ff3f6c;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ansk-pos-user-avatar-lg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ansk-pos-user-avatar-lg .ansk-pos-user-initials {
    font-size: 18px;
}

.ansk-pos-user-details {
    flex: 1;
    min-width: 0;
}

.ansk-pos-user-display-name {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: #1a1a1a;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ansk-pos-user-phone,
.ansk-pos-user-email {
    display: block;
    font-size: 13px;
    color: #666;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ansk-pos-user-menu-items {
    padding: 8px;
}

.ansk-pos-user-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 8px;
    color: #374151;
    text-decoration: none;
    font-size: 14px;
    transition: background 0.2s;
}

.ansk-pos-user-menu-item:hover {
    background: #f9fafb;
}

.ansk-pos-user-menu-item svg {
    width: 18px;
    height: 18px;
    color: #666;
}

.ansk-pos-user-logout {
    color: #dc2626;
}

.ansk-pos-user-logout svg {
    color: #dc2626;
}

/* Login Button (for header when not logged in) */
.ansk-pos-login-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: #ff3f6c;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px;
    text-decoration: none;
    transition: background 0.2s;
}

.ansk-pos-login-btn:hover {
    background: #e63560;
    color: #fff;
}

.ansk-pos-login-btn svg {
    width: 16px;
    height: 16px;
}

/* Account Page */
.ansk-pos-account-page {
    background: #f8f9fa;
    min-height: 100vh;
}

.ansk-pos-account-container {
    max-width: 480px;
    margin: 0 auto;
    padding: 20px;
}

.ansk-pos-account-header {
    margin-bottom: 24px;
}

.ansk-pos-account-header h1 {
    font-size: 24px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 16px 0 0;
}

/* Account Cards */
.ansk-pos-account-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    margin-bottom: 16px;
}

/* Profile Card */
.ansk-pos-profile-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 24px;
}

.ansk-pos-profile-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    overflow: hidden;
    background: #ff3f6c;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ansk-pos-profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ansk-pos-profile-avatar .ansk-pos-user-initials {
    font-size: 24px;
}

.ansk-pos-profile-name {
    font-size: 20px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 8px;
}

.ansk-pos-profile-detail {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #666;
    margin: 0 0 4px;
}

.ansk-pos-profile-detail svg {
    width: 16px;
    height: 16px;
    color: #9ca3af;
}

/* Menu Cards */
.ansk-pos-menu-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    text-decoration: none;
    transition: background 0.2s;
}

.ansk-pos-menu-card:hover {
    background: #f9fafb;
}

.ansk-pos-menu-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: #fef2f4;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ansk-pos-menu-icon svg {
    width: 22px;
    height: 22px;
    color: #ff3f6c;
}

.ansk-pos-menu-icon-credits {
    background: #ede9fe;
}

.ansk-pos-menu-icon-credits svg {
    color: #7c3aed;
}

.ansk-pos-menu-icon-wishlist {
    background: #fce7f3;
}

.ansk-pos-menu-icon-wishlist svg {
    color: #ec4899;
}

.ansk-pos-menu-icon-requests {
    background: #dbeafe;
}

.ansk-pos-menu-icon-requests svg {
    color: #3b82f6;
}

.ansk-pos-menu-icon-instore {
    background: #dcfce7;
}

.ansk-pos-menu-icon-instore svg {
    color: #16a34a;
}

.ansk-pos-menu-content {
    flex: 1;
}

.ansk-pos-menu-content h3 {
    font-size: 15px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 2px;
}

.ansk-pos-menu-content p {
    font-size: 13px;
    color: #666;
    margin: 0;
}

.ansk-pos-menu-arrow {
    width: 18px;
    height: 18px;
    color: #9ca3af;
}

/* Account Logout */
.ansk-pos-account-logout {
    margin-top: 32px;
    text-align: center;
}

.ansk-pos-account-logout .ansk-pos-btn {
    width: auto;
    padding: 12px 32px;
    font-size: 14px;
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .ansk-pos-auth-container {
        padding: 16px;
    }

    .ansk-pos-auth-card {
        padding: 24px 20px;
    }

    .ansk-pos-otp-digit {
        width: 44px;
        height: 52px;
        font-size: 20px;
    }

    .ansk-pos-user-name {
        display: none;
    }

    .ansk-pos-user-dropdown {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        border-radius: 16px 16px 0 0;
        transform: translateY(100%);
    }

    .ansk-pos-user-toggle[aria-expanded="true"] + .ansk-pos-user-dropdown {
        transform: translateY(0);
    }
}

/* Success Animation */
@keyframes successPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.ansk-pos-auth-success {
    animation: successPulse 0.3s ease;
}

/* Login Method Tabs */
.ansk-pos-auth-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    padding: 4px;
    background: #f3f4f6;
    border-radius: 10px;
}

.ansk-pos-auth-tab {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 500;
    color: #6b7280;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.ansk-pos-auth-tab:hover {
    color: #374151;
}

.ansk-pos-auth-tab.active {
    background: #fff;
    color: #ff3f6c;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.ansk-pos-auth-tab svg {
    flex-shrink: 0;
}

/* Password Input with Toggle */
.ansk-pos-password-input {
    position: relative;
    display: flex;
    align-items: stretch;
}

.ansk-pos-password-input .ansk-pos-input {
    padding-right: 48px;
}

.ansk-pos-password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: none;
    border: none;
    cursor: pointer;
    color: #9ca3af;
    padding: 0;
}

.ansk-pos-password-toggle:hover {
    color: #6b7280;
}

/* Forgot Password Link */
.ansk-pos-forgot-password {
    margin-bottom: 24px !important;
    text-align: right;
}

.ansk-pos-forgot-password a {
    font-size: 14px;
    color: #ff3f6c;
    text-decoration: none;
}

.ansk-pos-forgot-password a:hover {
    text-decoration: underline;
}

/* Switch Link */
.ansk-pos-auth-switch {
    text-align: center;
    margin-top: 20px;
}

.ansk-pos-auth-switch a {
    font-size: 14px;
    color: #ff3f6c;
    text-decoration: none;
    font-weight: 500;
}

.ansk-pos-auth-switch a:hover {
    text-decoration: underline;
}
