/* WP Custom Auth - Modern Apple-inspired Design System */

/* CSS Variables for easy customization */
:root {
    /* Colors */
    --wpca-primary: #007fc5;
    --wpca-primary-dark: #0066a1;
    --wpca-secondary: #5856D6;
    --wpca-success: #34C759;
    --wpca-warning: #FF9500;
    --wpca-danger: #FF3B30;
    --wpca-info: #5AC8FA;

    /* Neutral colors */
    --wpca-gray-100: #F2F2F7;
    --wpca-gray-200: #E5E5EA;
    --wpca-gray-300: #D1D1D6;
    --wpca-gray-400: #C7C7CC;
    --wpca-gray-500: #8E8E93;
    --wpca-gray-600: #636366;
    --wpca-gray-700: #48484A;
    --wpca-gray-800: #3A3A3C;
    --wpca-gray-900: #1C1C1E;

    /* Background colors */
    --wpca-bg-primary: #FFFFFF;
    --wpca-bg-secondary: #F2F2F7;
    --wpca-bg-tertiary: #FFFFFF;
    --wpca-bg-elevated: #FFFFFF;

    /* Text colors */
    --wpca-text-primary: #000000;
    --wpca-text-secondary: #3C3C43;
    --wpca-text-tertiary: #48484A;
    --wpca-text-quaternary: #636366;

    /* Effects */
    --wpca-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --wpca-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.04), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --wpca-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.04), 0 4px 6px -2px rgba(0, 0, 0, 0.02);
    --wpca-shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.04), 0 10px 10px -5px rgba(0, 0, 0, 0.02);

    /* Spacing */
    --wpca-spacing-xs: 4px;
    --wpca-spacing-sm: 8px;
    --wpca-spacing-md: 16px;
    --wpca-spacing-lg: 24px;
    --wpca-spacing-xl: 32px;
    --wpca-spacing-2xl: 48px;

    /* Border radius */
    --wpca-radius-sm: 6px;
    --wpca-radius-md: 10px;
    --wpca-radius-lg: 14px;
    --wpca-radius-xl: 20px;
    --wpca-radius-full: 9999px;

    /* Transitions */
    --wpca-transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --wpca-transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
    --wpca-transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);

    /* Font */
    --wpca-font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

/* Global Typography */
.wpca-portal-wrapper h1,
.wpca-auth-container h1,
.wpca-internal-area h1 {
    font-size: 32px;
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: var(--wpca-spacing-lg);
    color: var(--wpca-text-primary);
}

.wpca-portal-wrapper h2,
.wpca-auth-container h2,
.wpca-internal-area h2 {
    font-size: 24px;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: var(--wpca-spacing-md);
    color: var(--wpca-text-primary);
}

/* Portal wrapper - works with theme layout */
.wpca-portal-wrapper {
    background: #f8f8f8;
    display: flex;
    padding: 48px 0;
}

.wpca-portal-container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 0 var(--wpca-spacing-lg);
}

/* For auth pages, center the content */
body.wpca-portal-login .wpca-portal-container,
body.wpca-portal-register .wpca-portal-container,
body.wpca-portal-reset-password .wpca-portal-container,
body.wpca-portal-set-password .wpca-portal-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
}

/* Base styles */
.wpca-auth-container {
    max-width: 500px;
    width: 100%;
    margin: 0 auto;
    font-family: var(--wpca-font-family);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background: var(--wpca-bg-elevated);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--wpca-radius-xl);
    box-shadow: var(--wpca-shadow-xl);
    overflow: hidden;
    width: 50vw;
    max-width: 600px !important;
}

/* Tabs with modern design */
.wpca-tabs {
    display: flex;
    background: var(--wpca-bg-secondary);
    padding: var(--wpca-spacing-xs);
    margin: 0;
    border-bottom: none;
    gap: var(--wpca-spacing-xs);
}

.wpca-tab {
    flex: 1;
    padding: var(--wpca-spacing-sm) var(--wpca-spacing-md);
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    color: var(--wpca-text-secondary);
    transition: all var(--wpca-transition-base);
    border-radius: var(--wpca-radius-md);
    position: relative;
    overflow: hidden;
}

.wpca-tab::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--wpca-primary);
    opacity: 0;
    transition: opacity var(--wpca-transition-base);
}

.wpca-tab:hover {
    color: var(--wpca-text-primary);
}

.wpca-tab.active {
    background: var(--wpca-bg-primary);
    color: var(--wpca-primary);
    box-shadow: var(--wpca-shadow-sm);
}

.wpca-tab.active::before {
    opacity: 0.05;
}

/* Form containers */
.wpca-form-container {
    display: none;
    padding: var(--wpca-spacing-xl);
    animation: fadeIn var(--wpca-transition-slow) ease-out;
}

.wpca-form-container.active {
    display: block;
}

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

/* Form groups - Apple style with labels above */
.wpca-form-group {
    margin-bottom: var(--wpca-spacing-lg);
}

body[data-fancy-form-rcs="1"] .wpca-form-group .fancy-select-wrap label {
    display: block;
    margin-bottom: 6px;
    font-size: 18px !important;
    font-weight: 500;
    color: var(--wpca-text-primary) !important;
    letter-spacing: -0.01em;
}

.wpca-form-group input {
    width: 100%;
    padding: 13px 16px;
    border: 1px solid var(--wpca-gray-300);
    border-radius: var(--wpca-radius-md);
    font-size: 16px;
    font-family: var(--wpca-font-family);
    background: var(--wpca-bg-primary);
    color: var(--wpca-text-primary);
    transition: all var(--wpca-transition-base);
    -webkit-appearance: none;
}

.wpca-form-group input::placeholder {
    color: var(--wpca-text-quaternary);
    opacity: 1;
}

.wpca-form-group input:hover {
    border-color: var(--wpca-gray-400);
}

.wpca-form-group input:focus {
    outline: none;
    border-color: var(--wpca-primary);
    box-shadow: 0 0 0 3.5px rgba(0, 127, 197, 0.15);
}

.wpca-form-group input.error {
    border-color: var(--wpca-danger);
}

.wpca-form-group input.error:focus {
    box-shadow: 0 0 0 3.5px rgba(255, 59, 48, 0.15);
}

/* Select elements - matching input styles */
.wpca-form-group select {
    width: 100%;
    padding: 13px 16px;
    border: 1px solid var(--wpca-gray-300);
    border-radius: var(--wpca-radius-md);
    font-size: 16px;
    font-family: var(--wpca-font-family);
    background: var(--wpca-bg-primary);
    color: var(--wpca-text-primary);
    transition: all var(--wpca-transition-base);
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 20px;
    padding-right: 48px;
}

.wpca-form-group select:hover {
    border-color: var(--wpca-gray-400);
}

.wpca-form-group select:focus {
    outline: none;
    border-color: var(--wpca-primary);
    box-shadow: 0 0 0 3.5px rgba(0, 127, 197, 0.15);
}

.wpca-form-group select.error {
    border-color: var(--wpca-danger);
}

.wpca-form-group select.error:focus {
    box-shadow: 0 0 0 3.5px rgba(255, 59, 48, 0.15);
}

/* Buttons with Apple style - BULLETPROOF VERSION */
.wpca-btn,
.wpca-btn:link,
.wpca-btn:visited,
a.wpca-btn,
a.wpca-btn:link,
a.wpca-btn:visited,
button.wpca-btn,
input[type="submit"].wpca-btn,
input[type="button"].wpca-btn {
    /* Box Model */
    display: inline-flex !important;
    padding: var(--wpca-spacing-md) var(--wpca-spacing-xl) !important;
    margin: 0;
    min-height: 50px !important;
    width: auto;
    box-sizing: border-box !important;

    /* Visual */
    border: none !important;
    border-radius: var(--wpca-radius-full) !important;
    background-color: transparent;
    box-shadow: none;

    /* Typography */
    font-family: var(--wpca-font-family) !important;
    font-size: 17px !important;
    font-weight: 500 !important;
    line-height: 1.2 !important;
    text-align: center !important;
    text-decoration: none !important;
    text-transform: none !important;
    letter-spacing: normal !important;

    /* Behavior */
    cursor: pointer !important;
    transition: all var(--wpca-transition-base) !important;
    outline: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;

    /* Layout */
    align-items: center !important;
    justify-content: center !important;
    gap: var(--wpca-spacing-sm) !important;
    position: relative !important;
    overflow: hidden !important;
    vertical-align: middle !important;
}

/* Button ripple effect */
.wpca-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.wpca-btn:active::before {
    width: 300px;
    height: 300px;
}

/* Primary button styles - increased specificity */
.wpca-btn.wpca-btn-primary,
.wpca-btn-primary.wpca-btn,
a.wpca-btn.wpca-btn-primary,
button.wpca-btn.wpca-btn-primary,
input[type="submit"].wpca-btn.wpca-btn-primary,
.wpca-form .wpca-btn-primary,
.wpca-form-actions .wpca-btn-primary {
    background-color: var(--wpca-primary) !important;
    background-image: none !important;
    color: white !important;
    box-shadow: var(--wpca-shadow-md) !important;
    border: none !important;
}

/* Primary button hover states */
.wpca-btn.wpca-btn-primary:hover,
.wpca-btn-primary.wpca-btn:hover,
a.wpca-btn.wpca-btn-primary:hover,
button.wpca-btn.wpca-btn-primary:hover,
.wpca-form .wpca-btn-primary:hover,
.wpca-form-actions .wpca-btn-primary:hover {
    background-color: var(--wpca-primary-dark) !important;
    background-image: none !important;
    color: white !important;
    transform: translateY(-1px) !important;
    box-shadow: var(--wpca-shadow-lg) !important;
    border: none !important;
    text-decoration: none !important;
    opacity: 1 !important;
}

/* Primary button active states */
.wpca-btn.wpca-btn-primary:active,
.wpca-btn-primary.wpca-btn:active,
a.wpca-btn.wpca-btn-primary:active,
button.wpca-btn.wpca-btn-primary:active {
    transform: translateY(0) !important;
    box-shadow: var(--wpca-shadow-sm) !important;
    background-color: var(--wpca-primary-dark) !important;
    color: white !important;
}

/* Secondary button styles */
.wpca-btn.wpca-btn-secondary,
.wpca-btn-secondary.wpca-btn,
a.wpca-btn.wpca-btn-secondary,
button.wpca-btn.wpca-btn-secondary {
    background-color: var(--wpca-bg-secondary) !important;
    background-image: none !important;
    color: var(--wpca-primary) !important;
    border: none !important;
}

.wpca-btn.wpca-btn-secondary:hover,
.wpca-btn-secondary.wpca-btn:hover,
a.wpca-btn.wpca-btn-secondary:hover {
    background-color: var(--wpca-gray-200) !important;
    background-image: none !important;
    color: var(--wpca-primary) !important;
    text-decoration: none !important;
    border: none !important;
}

/* Link button styles */
.wpca-btn.wpca-btn-link,
.wpca-btn-link.wpca-btn,
a.wpca-btn.wpca-btn-link {
    background-color: transparent !important;
    background-image: none !important;
    color: var(--wpca-primary) !important;
    padding: var(--wpca-spacing-sm) !important;
    min-height: auto !important;
    box-shadow: none !important;
    border: none !important;
}

.wpca-btn.wpca-btn-link:hover,
.wpca-btn-link.wpca-btn:hover,
a.wpca-btn.wpca-btn-link:hover {
    background-color: transparent !important;
    color: var(--wpca-primary) !important;
    opacity: 0.7 !important;
    text-decoration: none !important;
    box-shadow: none !important;
    border: none !important;
}

/* Ghost button styles */
.wpca-btn.wpca-btn-ghost,
.wpca-btn-ghost.wpca-btn,
a.wpca-btn.wpca-btn-ghost,
button.wpca-btn.wpca-btn-ghost {
    background-color: transparent !important;
    color: var(--wpca-text-secondary) !important;
    border: 1px solid var(--wpca-gray-300) !important;
}

.wpca-btn.wpca-btn-ghost:hover,
a.wpca-btn.wpca-btn-ghost:hover {
    background-color: var(--wpca-bg-secondary) !important;
    border-color: var(--wpca-gray-400) !important;
    color: var(--wpca-text-secondary) !important;
    text-decoration: none !important;
}

/* Small button modifier */
.wpca-btn.wpca-btn-sm,
.wpca-btn-sm.wpca-btn {
    padding: var(--wpca-spacing-sm) var(--wpca-spacing-md) !important;
    font-size: 14px !important;
    min-height: 36px !important;
}

/* Button focus states with high specificity */
.wpca-btn:focus,
.wpca-btn:focus-visible,
.wpca-btn.wpca-btn-primary:focus,
.wpca-btn.wpca-btn-secondary:focus,
.wpca-btn.wpca-btn-link:focus,
a.wpca-btn:focus,
button.wpca-btn:focus {
    outline: none !important;
    box-shadow: 0 0 0 4px rgba(0, 127, 197, 0.3) !important;
}

/* Disabled state */
.wpca-btn:disabled,
.wpca-btn[disabled],
.wpca-btn.disabled,
button.wpca-btn:disabled,
a.wpca-btn.disabled {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
}

/* Loading state with high specificity */
.wpca-btn.wpca-loading,
.wpca-loading.wpca-btn,
button.wpca-btn.wpca-loading {
    color: transparent !important;
    pointer-events: none !important;
}

/* Wide button for forms */
.wpca-form-actions .wpca-btn,
.wpca-auth-container .wpca-btn-primary {
    width: 100% !important;
}

/* Form actions */
.wpca-form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: var(--wpca-spacing-xl);
    gap: var(--wpca-spacing-md);
}

.wpca-form-alternative {
    margin-top: var(--wpca-spacing-xl);
    text-align: center;
    padding-top: var(--wpca-spacing-xl);
    border-top: 1px solid var(--wpca-gray-200);
}

/* Form links */
.wpca-form-link {
    text-align: center;
    margin-top: var(--wpca-spacing-md);
    font-size: 14px;
}

.wpca-form-link a {
    color: var(--wpca-primary);
    text-decoration: none;
    transition: opacity var(--wpca-transition-base);
}

.wpca-form-link a:hover {
    opacity: 0.8;
}

/* Messages with modern style */
.wpca-messages {
    margin: 0 32px 32px;
}

.wpca-message {
    padding: var(--wpca-spacing-md) var(--wpca-spacing-lg);
    border-radius: var(--wpca-radius-md);
    margin-bottom: var(--wpca-spacing-md);
    font-size: 15px;
    animation: slideIn var(--wpca-transition-slow) ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.wpca-message-success {
    background: rgba(52, 199, 89, 0.1);
    color: var(--wpca-success);
    border: 1px solid rgba(52, 199, 89, 0.2);
}

.wpca-message-error {
    background: rgba(255, 59, 48, 0.1);
    color: var(--wpca-danger);
    border: 1px solid rgba(255, 59, 48, 0.2);
}

/* Field errors */
.wpca-field-error {
    color: var(--wpca-danger);
    font-size: 13px;
    margin-top: var(--wpca-spacing-xs);
    animation: shake var(--wpca-transition-base) ease-in-out;
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-5px);
    }
    75% {
        transform: translateX(5px);
    }
}

/* Password strength indicator */
#password-strength-indicator {
    margin-top: var(--wpca-spacing-sm);
    padding: var(--wpca-spacing-xs) var(--wpca-spacing-md);
    border-radius: var(--wpca-radius-full);
    font-size: 12px;
    font-weight: 500;
    text-align: center;
    transition: all var(--wpca-transition-base);
}

#password-strength-indicator.weak {
    background: rgba(255, 59, 48, 0.1);
    color: var(--wpca-danger);
}

#password-strength-indicator.medium {
    background: rgba(255, 149, 0, 0.1);
    color: var(--wpca-warning);
}

#password-strength-indicator.strong {
    background: rgba(52, 199, 89, 0.1);
    color: var(--wpca-success);
}

/* Loading spinner */
.wpca-loading {
    position: relative;
    color: transparent !important;
}

.wpca-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Spinner with specificity */
.wpca-btn .wpca-spinner,
.wpca-loading .wpca-spinner,
.wpca-btn.wpca-loading .wpca-spinner {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    width: 20px !important;
    height: 20px !important;
    margin: -10px 0 0 -10px !important;
    border: 2px solid rgba(255, 255, 255, 0.3) !important;
    border-top-color: white !important;
    border-radius: 50% !important;
    animation: spin 0.8s linear infinite !important;
}

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

/* Internal area dashboard */
.wpca-internal-area {
    max-width: 1200px;
    margin: 0 auto;
    font-family: var(--wpca-font-family);
}

.wpca-welcome-section {
    background: linear-gradient(135deg, var(--wpca-primary), var(--wpca-secondary));
    padding: var(--wpca-spacing-2xl);
    border-radius: var(--wpca-radius-xl);
    margin-bottom: var(--wpca-spacing-xl);
    text-align: center;
    color: white;
    box-shadow: var(--wpca-shadow-xl);
}

.wpca-welcome-section h2 {
    margin-bottom: var(--wpca-spacing-sm);
    font-size: 28px;
    font-weight: 600;
}

.wpca-welcome-section p {
    font-size: 18px;
    opacity: 0.9;
}

.wpca-user-info {
    background: var(--wpca-bg-elevated);
    padding: var(--wpca-spacing-xl);
    border-radius: var(--wpca-radius-xl);
    box-shadow: var(--wpca-shadow-lg);
    margin-bottom: var(--wpca-spacing-xl);
}

.wpca-user-info h3 {
    margin-bottom: var(--wpca-spacing-lg);
    font-size: 20px;
    font-weight: 600;
    color: var(--wpca-text-primary);
}

.wpca-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--wpca-spacing-md);
}

.wpca-info-item {
    font-size: 14px;
    color: var(--wpca-text-primary);
}

.wpca-info-item strong {
    font-weight: 500;
    color: var(--wpca-text-primary);
}

.wpca-info-item span {
    color: var(--wpca-text-primary);
}

/* Menu Auth Buttons - Apple Design for Secondary Nav */
.wpca-auth-menu-container {
    display: flex !important;
    align-items: center;
}

.wpca-menu-auth-buttons {
    display: flex !important;
    align-items: center;
    gap: 8px;
    font-family: var(--wpca-font-family);
}

.wpca-menu-auth-buttons {
    border: 2px solid #ffffff;
    border-radius: var(--wpca-radius-xl);
    padding: 10px 16px !important;
    margin-left: 12px !important;
    opacity: .75;
    transition: all var(--wpca-transition-base);
    font-family: Roboto, sans-serif;
}

body[data-header-color=light] .wpca-menu-auth-buttons {
    border: 2px solid #999 !important;
}

.wpca-menu-auth-buttons:focus,
.wpca-menu-auth-buttons:hover {
    opacity: 1;
}

body[data-header-color=light] .wpca-menu-auth-buttons.logged-out {
    border-color: var(--wpca-gray-300);
}


#header-outer.transparent .wpca-menu-auth-buttons a {
    color: white  !important;
}

.wpca-menu-auth-buttons .wpca-menu-btn:not(:last-child):after {
    content: " /";
}

/* Menu button styles */
#top a.wpca-menu-btn {
    display: inline-block;
    line-height: 1;
    text-decoration: none;
    transition: all var(--wpca-transition-base);
    white-space: nowrap;
    font-size: 16px !important;
    font-weight: 500;
    opacity: .75;
    color: #666 !important;
}


#top a.wpca-menu-btn:hover,
#top a.wpca-menu-btn:focus {
    opacity: 1;
}

#header-outer.light-text .wpca-menu-btn {
    opacity: .75;
    color: white !important;
}

.wpca-menu-btn-logout {
    color: var(--wpca-text-secondary);
    background: transparent;
    border: 1px solid transparent;
}

.wpca-menu-btn-logout:hover {
    color: var(--wpca-danger);
}

.wpca-menu-user-name {
    color: var(--wpca-text-primary);
    font-size: 18px;
    margin-right: 4px;
}


body[data-header-color=light] .wpca-menu-user-name {
    color: white;
}


/* 404 Page */
.wpca-404-container {
    text-align: center;
    padding: var(--wpca-spacing-2xl);
}

.wpca-404-container h1 {
    font-size: 48px;
    margin-bottom: var(--wpca-spacing-lg);
    color: var(--wpca-text-primary);
}

/* Custom page */
.wpca-custom-page {
    background: var(--wpca-bg-elevated);
    padding: var(--wpca-spacing-xl);
    border-radius: var(--wpca-radius-xl);
    box-shadow: var(--wpca-shadow-lg);
}

.wpca-custom-page h1 {
    margin-bottom: var(--wpca-spacing-xl);
    color: var(--wpca-text-primary);
}

/* Restricted content */
.wpca-restricted-message,
.wpca-restricted-content-message {
    padding: var(--wpca-spacing-2xl);
    background: var(--wpca-bg-secondary);
    border-radius: var(--wpca-radius-xl);
    text-align: center;
    margin: var(--wpca-spacing-xl) 0;
}

.wpca-login-link {
    display: inline-flex;
    align-items: center;
    margin-top: var(--wpca-spacing-md);
    padding: var(--wpca-spacing-md) var(--wpca-spacing-xl);
    background: var(--wpca-primary);
    color: white;
    text-decoration: none;
    border-radius: var(--wpca-radius-full);
    font-weight: 500;
    transition: all var(--wpca-transition-base);
}

.wpca-login-link:hover {
    background: var(--wpca-primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--wpca-shadow-md);
}

/* Extended form container for wider forms */
.wpca-auth-container-wide {
    max-width: 700px;
}

/* Form row for side-by-side fields */
.wpca-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--wpca-spacing-md);
}

/* Required field indicator */
.required {
    color: var(--wpca-danger);
}

/* Select styling */
.wpca-form-group select {
    width: 100%;
    padding: 13px 16px;
    border: 1px solid var(--wpca-gray-300);
    border-radius: var(--wpca-radius-md);
    font-size: 16px;
    font-family: var(--wpca-font-family);
    background: var(--wpca-bg-primary);
    color: var(--wpca-text-primary);
    transition: all var(--wpca-transition-base);
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23636366' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

.wpca-form-group select:hover {
    border-color: var(--wpca-gray-400);
}

.wpca-form-group select:focus {
    outline: none;
    border-color: var(--wpca-primary);
    box-shadow: 0 0 0 3.5px rgba(0, 127, 197, 0.15);
}

/* Sidebar layout */
.wpca-has-sidebar .wpca-portal-container {
    display: flex;
    gap: 0;
    max-width: 1400px;
    min-height: calc(100vh - 680px);
    align-items: stretch;
}

/* Sidebar styles */
.wpca-sidebar {
    width: 280px;
    background: var(--wpca-bg-elevated);
    /*border-right: 1px solid var(--wpca-gray-200);*/
    border-radius: var(--wpca-radius-xl);;
    /*min-height: 100vh;*/
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    /*height: 100vh;*/
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.wpca-sidebar-nav {
    flex: 1;
    padding: var(--wpca-spacing-lg);
    overflow-y: auto;
    /* Custom scrollbar for webkit browsers */
    scrollbar-width: thin;
    scrollbar-color: var(--wpca-gray-300) transparent;
}

.wpca-sidebar-nav::-webkit-scrollbar {
    width: 6px;
}

.wpca-sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}

.wpca-sidebar-nav::-webkit-scrollbar-thumb {
    background-color: var(--wpca-gray-300);
    border-radius: 3px;
}

.wpca-sidebar-nav::-webkit-scrollbar-thumb:hover {
    background-color: var(--wpca-gray-400);
}

.wpca-sidebar-menu {
    list-style: none;
    margin: 0;
    padding: 0;
}

.wpca-sidebar-item {
    list-style: none;
    margin-bottom: var(--wpca-spacing-xs);
}

.wpca-sidebar-link {
    display: flex;
    align-items: center;
    gap: var(--wpca-spacing-md);
    padding: var(--wpca-spacing-md) var(--wpca-spacing-lg);
    color: var(--wpca-text-secondary);
    text-decoration: none;
    border-radius: var(--wpca-radius-md);
    transition: all var(--wpca-transition-base);
    font-size: 15px;
    font-weight: 500;
}

.wpca-sidebar-link:hover {
    background: var(--wpca-bg-secondary);
    color: var(--wpca-text-primary);
}

.wpca-sidebar-item.active .wpca-sidebar-link,
.wpca-sidebar-profile-link.active {
    background: var(--wpca-primary);
    color: white;
}

.wpca-sidebar-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* Sidebar profile section */
.wpca-sidebar-profile {
    padding: var(--wpca-spacing-lg);
    border-top: 1px solid var(--wpca-gray-200);
    background: var(--wpca-bg-elevated);
    position: sticky;
    bottom: 0;
    margin-top: auto;
}

.wpca-sidebar-profile-link {
    display: flex;
    align-items: center;
    gap: var(--wpca-spacing-md);
    padding: var(--wpca-spacing-md) var(--wpca-spacing-lg);
    color: var(--wpca-text-secondary);
    text-decoration: none;
    border-radius: var(--wpca-radius-md);
    transition: all var(--wpca-transition-base);
    font-size: 15px;
    font-weight: 500;
}

.wpca-sidebar-profile-link:hover {
    background: var(--wpca-bg-secondary);
    color: var(--wpca-text-primary);
}

/* Avatar */
.wpca-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--wpca-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 12px;
    flex-shrink: 0;
}

/* Portal content area */
.wpca-has-sidebar .wpca-portal-content {
    flex: 1;
    padding: var(--wpca-spacing-xl);
    /*background: var(--wpca-bg-secondary);*/
    /*min-height: 100vh;*/
}

/* Page header */
.wpca-page-header {
    margin-bottom: var(--wpca-spacing-xl);
}

.wpca-page-header h1 {
    font-size: 32px;
    font-weight: 600;
    margin-bottom: var(--wpca-spacing-sm);
    color: var(--wpca-text-primary);
}

.wpca-page-header p {
    font-size: 16px;
    color: var(--wpca-text-secondary);
}

/* Dashboard grid */
.wpca-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--wpca-spacing-xl);
}

.wpca-dashboard-card {
    background: var(--wpca-bg-elevated);
    padding: var(--wpca-spacing-xl);
    border-radius: var(--wpca-radius-xl);
    box-shadow: var(--wpca-shadow-sm);
}

.wpca-dashboard-card h3 {
    margin-bottom: var(--wpca-spacing-lg);
    font-size: 18px;
    font-weight: 600;
    color: var(--wpca-text-primary);
}

/* Quick actions */
.wpca-quick-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--wpca-spacing-md);
}

.wpca-action-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--wpca-spacing-md);
    padding: var(--wpca-spacing-lg);
    background: var(--wpca-bg-secondary);
    border-radius: var(--wpca-radius-lg);
    text-decoration: none;
    color: var(--wpca-text-primary);
    text-align: center;
    transition: all var(--wpca-transition-base);
}

.wpca-action-card:hover {
    background: var(--wpca-primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--wpca-shadow-md);
}

.wpca-action-icon {
    width: 32px;
    height: 32px;
    color: var(--wpca-primary);
}

.wpca-action-card:hover .wpca-action-icon {
    color: white;
}

/* Info summary */
.wpca-info-summary {
    display: flex;
    flex-direction: column;
    gap: var(--wpca-spacing-md);
}

.wpca-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--wpca-spacing-sm) 0;
    border-bottom: 1px solid var(--wpca-gray-100);
}

.wpca-info-row:last-child {
    border-bottom: none;
}

.wpca-info-label {
    font-weight: 500;
    color: var(--wpca-text-tertiary);
}

.wpca-info-value {
    color: var(--wpca-text-primary);
}

/* Profile sections */
.wpca-profile-sections {
    display: flex;
    flex-direction: column;
    gap: var(--wpca-spacing-2xl);
}

.wpca-profile-section {
    background: var(--wpca-bg-elevated);
    padding: var(--wpca-spacing-xl);
    border-radius: var(--wpca-radius-xl);
    box-shadow: var(--wpca-shadow-sm);
}

.wpca-profile-section h2 {
    margin-bottom: var(--wpca-spacing-xl);
    font-size: 20px;
    font-weight: 600;
    color: var(--wpca-text-primary);
}

/* Coming soon */
.wpca-coming-soon {
    text-align: center;
    padding: var(--wpca-spacing-2xl) 0;
}

.wpca-coming-soon-icon {
    width: 64px;
    height: 64px;
    color: var(--wpca-gray-400);
    margin-bottom: var(--wpca-spacing-lg);
}

.wpca-coming-soon h2 {
    font-size: 24px;
    font-weight: 600;
    color: var(--wpca-text-primary);
    margin-bottom: var(--wpca-spacing-md);
}

.wpca-coming-soon p {
    color: var(--wpca-text-secondary);
    font-size: 16px;
}

/* Product grid */
.wpca-product-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--wpca-spacing-xl);
}

.wpca-product-card {
    background: var(--wpca-bg-elevated);
    border-radius: var(--wpca-radius-xl);
    overflow: hidden;
    box-shadow: var(--wpca-shadow-sm);
    transition: all var(--wpca-transition-base);
}

.wpca-product-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--wpca-shadow-lg);
}

.wpca-product-image {
    width: 100%;
    aspect-ratio: 1;
    background: var(--wpca-gray-100);
    border-radius: 12px;
    overflow: hidden;
}

.wpca-product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.wpca-product-content {
    padding: var(--wpca-spacing-lg);
}

.wpca-product-card h3 {
    margin-bottom: 0;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.25;
}

.wpca-warranty-status {
    display: flex;
    align-items: center;
    gap: var(--wpca-spacing-xs);
    padding: 0;
}

/* Table styles */
.wpca-table-container {
    background: var(--wpca-bg-elevated);
    border-radius: var(--wpca-radius-xl);
    overflow: hidden;
    box-shadow: var(--wpca-shadow-sm);
}

.wpca-table {
    width: 100%;
    border-collapse: collapse;
}

.wpca-table th {
    background: var(--wpca-bg-secondary);
    padding: var(--wpca-spacing-md) var(--wpca-spacing-lg);
    text-align: left;
    font-weight: 600;
    color: var(--wpca-text-secondary);
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.wpca-table td {
    padding: var(--wpca-spacing-md) var(--wpca-spacing-lg);
    border-top: 1px solid var(--wpca-gray-200);
}

.wpca-table tbody tr:hover {
    background: var(--wpca-bg-secondary);
}

.wpca-badge {
    background: var(--wpca-primary);
    color: white;
    padding: 4px 12px;
    border-radius: var(--wpca-radius-full);
    font-size: 12px;
    font-weight: 600;
}

/* Form sections */
.wpca-form-section {
    background: var(--wpca-bg-elevated);
    padding: var(--wpca-spacing-xl);
    border-radius: var(--wpca-radius-xl);
    box-shadow: var(--wpca-shadow-sm);
}

.wpca-form-info {
    background: var(--wpca-bg-secondary);
    padding: var(--wpca-spacing-lg);
    border-radius: var(--wpca-radius-md);
    margin: var(--wpca-spacing-xl) 0;
    gap: var(--wpca-spacing-md);
    align-items: flex-start;
    flex-direction: row;
}

.wpca-info-icon {
    flex-shrink: 0;
    color: var(--wpca-info);
}

.wpca-form-info p:last-child {
    padding-bottom: 0;
    margin-bottom: 0;
}

.wpca-warning-box {
    background: rgba(255, 149, 0, 0.1);
    border: 1px solid rgba(255, 149, 0, 0.3);
    padding: var(--wpca-spacing-lg);
    border-radius: var(--wpca-radius-md);
    margin: var(--wpca-spacing-lg) 0;
    display: flex;
    gap: var(--wpca-spacing-md);
    align-items: center;
    width: 100%;
}

.wpca-warning-box p:last-child {
    padding: 0;
}

.wpca-warning-icon {
    color: var(--wpca-warning);
    flex-shrink: 0;
}

/* Upload box */
.wpca-upload-box {
    border: 2px dashed var(--wpca-gray-300);
    border-radius: var(--wpca-radius-xl);
    padding: var(--wpca-spacing-2xl);
    text-align: center;
    transition: all var(--wpca-transition-base);
}

.wpca-upload-box:hover {
    border-color: var(--wpca-primary);
    background: var(--wpca-bg-secondary);
}

.wpca-upload-icon {
    color: var(--wpca-gray-400);
    margin-bottom: var(--wpca-spacing-lg);
}

.wpca-upload-box input[type="file"] {
    display: none;
}

.wpca-upload-section {
    margin-bottom: var(--wpca-spacing-xl);
}

/* Empty state */
.wpca-empty-state {
    text-align: center;
    padding: var(--wpca-spacing-2xl) 0;
}

.wpca-empty-icon {
    color: var(--wpca-gray-400);
    margin-bottom: var(--wpca-spacing-lg);
}

/* Page actions */
.wpca-page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-direction: column;
    margin-bottom: var(--wpca-spacing-xl);
}

.wpca-page-actions {
    display: flex;
    gap: var(--wpca-spacing-md);
}

.wpca-btn-icon {
    width: 20px;
    height: 20px;
}

/* Serial validation message */
#serial-validation-message {
    margin-top: var(--wpca-spacing-sm);
    font-size: 14px;
}

#serial-validation-message.valid {
    color: var(--wpca-success);
}

#serial-validation-message.invalid {
    color: var(--wpca-danger);
}

/* Admin dashboard specific */
.wpca-dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--wpca-spacing-lg);
    margin-bottom: var(--wpca-spacing-2xl);
}

.wpca-stat-card {
    background: var(--wpca-bg-elevated);
    padding: var(--wpca-spacing-lg);
    border-radius: var(--wpca-radius-lg);
    text-align: center;
    box-shadow: var(--wpca-shadow-sm);
}

.wpca-stat-number {
    font-size: 36px;
    font-weight: 700;
    color: var(--wpca-primary);
    margin-bottom: var(--wpca-spacing-sm);
}

.wpca-stat-label {
    color: var(--wpca-text-secondary);
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Small text helper */
.wpca-form-group small {
    display: block;
    margin-top: var(--wpca-spacing-xs);
    color: var(--wpca-text-quaternary);
    font-size: 13px;
}

/* Theme integration styles */
.wpca-set-password-container {
    max-width: 400px;
    margin: 0 auto;
    background: var(--wpca-bg-elevated);
    padding: var(--wpca-spacing-xl);
    border-radius: var(--wpca-radius-xl);
    box-shadow: var(--wpca-shadow-xl);
}

.wpca-set-password-container h2 {
    margin-bottom: var(--wpca-spacing-xl);
    text-align: center;
    color: var(--wpca-text-primary);
}

/* Headline styling for all auth containers */
.wpca-auth-container h2,
.wpca-auth-container-wide h2 {
    margin: 0;
    padding: var(--wpca-spacing-lg) var(--wpca-spacing-xl);
    font-size: 24px;
    font-weight: 600;
    text-align: center;
    color: var(--wpca-text-primary);
    background: var(--wpca-bg-secondary);
    border-bottom: 1px solid var(--wpca-gray-200);
}

/* Ensure proper spacing when using theme header/footer */
.site-header + .wpca-portal-wrapper {
    margin-top: 0;
}

.wpca-portal-wrapper + .site-footer {
    margin-top: 0;
}

/* If theme has transparent header, add background */
.wpca-portal .site-header {
    background: var(--wpca-bg-primary);
    border-bottom: 1px solid var(--wpca-gray-200);
}

/* Reset WooCommerce button styles if present */
.woocommerce .wpca-btn,
.woocommerce-page .wpca-btn {
    background-image: none !important;
    text-shadow: none !important;
}

/* WordPress admin bar compatibility */
.admin-bar .wpca-btn {
    margin-top: 0 !important;
}

/* Ensure buttons in modals/popups work */
.modal .wpca-btn,
.popup .wpca-btn,
[role="dialog"] .wpca-btn {
    z-index: 9999;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Better tap targets for mobile */
@media (hover: none) {
    .wpca-btn,
    .wpca-tab,
    .wpca-form-group input,
    a.wpca-btn,
    button.wpca-btn {
        min-height: 44px !important;
    }
}

/* Responsive design */
@media (max-width: 768px) {
    .wpca-portal-container {
        padding: 0 var(--wpca-spacing-md);
    }

    .wpca-auth-container {
        margin: 0 auto;
    }

    .wpca-form-container {
        padding: var(--wpca-spacing-lg);
    }

    .wpca-form-actions {
        flex-direction: column;
    }

    .wpca-btn {
        width: 100%;
    }

    .wpca-menu-auth-buttons {
        gap: 6px;
    }

    .wpca-menu-btn {
        padding: 4px 10px !important;
        font-size: 11px !important;
    }

    .wpca-menu-user-name {
        display: none;
    }

    .wpca-welcome-section {
        padding: var(--wpca-spacing-xl);
    }

    .wpca-welcome-section h2 {
        font-size: 24px;
    }

    .wpca-welcome-section p {
        font-size: 16px;
    }

    .wpca-form-row {
        grid-template-columns: 1fr;
    }

    .wpca-quick-actions {
        grid-template-columns: 1fr;
    }

    .wpca-dashboard-grid {
        grid-template-columns: 1fr;
    }

    .wpca-product-grid {
        grid-template-columns: 1fr;
    }
}

/* Tablet breakpoint */
@media (max-width: 1024px) {
    .wpca-product-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Responsive sidebar */
@media (max-width: 1024px) {
    .wpca-has-sidebar .wpca-portal-container {
        flex-direction: column;
        min-height: auto;
    }

    .wpca-sidebar {
        width: 100%;
        min-height: auto;
        height: auto;
        position: static;
        border-right: none;
        border-bottom: 1px solid var(--wpca-gray-200);
        overflow: visible;
    }

    .wpca-sidebar-nav {
        padding: var(--wpca-spacing-md);
        overflow-y: visible;
    }

    .wpca-sidebar-profile {
        position: static;
        margin-top: 0;
    }

    .wpca-sidebar-menu {
        display: flex;
        gap: var(--wpca-spacing-md);
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .wpca-sidebar-item {
        margin-bottom: 0;
    }

    .wpca-sidebar-link {
        white-space: nowrap;
        padding: var(--wpca-spacing-sm) var(--wpca-spacing-md);
    }

    .wpca-sidebar-profile {
        display: none;
    }

    .wpca-has-sidebar .wpca-portal-content {
        padding: var(--wpca-spacing-lg);
        min-height: auto;
    }

    .wpca-portal-wrapper {
        min-height: auto;
    }
}

/* Drag and drop states */
.wpca-upload-box.drag-over {
    border-color: var(--wpca-primary);
    background: rgba(0, 127, 197, 0.05);
}

.wpca-upload-box.file-selected {
    border-color: var(--wpca-success);
}

#file-selected {
    margin-top: var(--wpca-spacing-lg);
}

.wpca-file-name {
    font-weight: 500;
    color: var(--wpca-text-primary);
    display: inline-flex;
    align-items: center;
    gap: var(--wpca-spacing-sm);
}

.wpca-file-name::before {
    content: '✓';
    color: var(--wpca-success);
    font-weight: bold;
}

.wpca-example-box {
    background: var(--wpca-bg-secondary);
    border: 1px solid var(--wpca-gray-200);
    padding: var(--wpca-spacing-md);
    border-radius: var(--wpca-radius-sm);
    margin-top: var(--wpca-spacing-md);
    width: 100%;
}

.wpca-example-box h5 {
    margin: 0 0 var(--wpca-spacing-sm) 0;
    font-size: 14px;
    font-weight: 600;
}

.wpca-example-box pre {
    margin: 0;
    font-family: monospace;
    font-size: 12px;
    line-height: 1.5;
    background: var(--wpca-bg-primary);
    padding: var(--wpca-spacing-sm);
    border-radius: var(--wpca-radius-sm);
    overflow-x: auto;
}

/* Select2 Custom Styling */
.wpca-form-group .select2-container {
    width: 100% !important;
}

.wpca-form-group .select2-container--default .select2-selection--single {
    height: auto;
    padding: 13px 16px;
    border: 1px solid var(--wpca-gray-300);
    border-radius: var(--wpca-radius-md);
    background: var(--wpca-bg-primary);
    font-size: 16px;
    font-family: var(--wpca-font-family);
    transition: all var(--wpca-transition-base);
}

.wpca-form-group .select2-container--default .select2-selection--single:hover {
    border-color: var(--wpca-gray-400);
}

.wpca-form-group .select2-container--default.select2-container--focus .select2-selection--single,
.wpca-form-group .select2-container--default.select2-container--open .select2-selection--single {
    border-color: var(--wpca-primary);
    box-shadow: 0 0 0 3.5px rgba(0, 127, 197, 0.15);
    outline: none;
}

.wpca-form-group .select2-container--default .select2-selection--single .select2-selection__rendered {
    color: var(--wpca-text-primary);
    line-height: normal;
    padding-left: 0;
    padding-right: 30px;
}

.wpca-form-group .select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: var(--wpca-text-quaternary);
}

.wpca-form-group .select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 100%;
    right: 16px;
    top: 0;
}

.wpca-form-group .select2-container--default .select2-selection--single .select2-selection__arrow b {
    border-color: var(--wpca-gray-600) transparent transparent transparent;
    border-width: 6px 5px 0 5px;
    margin-left: -5px;
    margin-top: -3px;
    position: absolute;
    top: 50%;
}

/* Select2 Dropdown */
.select2-dropdown {
    border: 1px solid var(--wpca-gray-300);
    border-radius: var(--wpca-radius-md);
    box-shadow: var(--wpca-shadow-xl);
    margin-top: 4px;
    overflow: hidden;
}

.select2-search--dropdown {
    padding: var(--wpca-spacing-md);
    background: var(--wpca-bg-secondary);
    border-bottom: 1px solid var(--wpca-gray-200);
}

.select2-search--dropdown .select2-search__field {
    width: 100%;
    padding: 10px 16px;
    border: 1px solid var(--wpca-gray-300);
    border-radius: var(--wpca-radius-sm);
    font-size: 15px;
    font-family: var(--wpca-font-family);
    transition: all var(--wpca-transition-base);
}

.select2-search--dropdown .select2-search__field:focus {
    outline: none;
    border-color: var(--wpca-primary);
    box-shadow: 0 0 0 3px rgba(0, 127, 197, 0.1);
}

.select2-results {
    max-height: 300px;
}

.select2-results__options {
    padding: var(--wpca-spacing-sm) 0;
}

.select2-results__option {
    padding: 10px 16px;
    font-size: 15px;
    color: var(--wpca-text-primary);
    transition: all var(--wpca-transition-fast);
    cursor: pointer;
}

.select2-results__option--highlighted {
    background: var(--wpca-primary);
    color: white;
}

.select2-results__option--selected {
    background: var(--wpca-gray-100);
    font-weight: 500;
}

.select2-results__option--disabled {
    color: var(--wpca-text-quaternary);
    cursor: not-allowed;
}

/* Select2 for dark backgrounds (if needed) */
.wpca-dark-bg .select2-container--default .select2-selection--single {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: white;
}

.wpca-dark-bg .select2-container--default .select2-selection--single .select2-selection__rendered {
    color: white;
}

/* Terms Agreement Section */
.wpca-form-agreement {
    margin-top: var(--wpca-spacing-lg);
    margin-bottom: var(--wpca-spacing-md);
    font-size: 14px;
    color: var(--wpca-text-tertiary);
    text-align: center;
    line-height: 1.5;
}

.wpca-form-agreement a {
    color: var(--wpca-primary);
    text-decoration: none;
    font-weight: 500;
    transition: all var(--wpca-transition-base);
}

.wpca-form-agreement a:hover {
    color: var(--wpca-primary-dark);
    text-decoration: underline;
}

.wpca-form-agreement a:focus {
    outline: none;
    text-decoration: underline;
    box-shadow: 0 0 0 2px rgba(0, 127, 197, 0.3);
    border-radius: 2px;
    padding: 0 2px;
    margin: 0 -2px;
}

/* Warranty icon styling */
.wpca-warranty-icon {
    color: var(--wpca-text-primary);
    width: 16px;
    height: 16px;
}

/* Product info styling */
.wpca-product-info {
    color: var(--wpca-text-primary);
}

.wpca-product-registration .wpca-product-info {
    font-size: 14px;
}


.wpca-info-label {
    font-weight: 500;
    margin-right: var(--wpca-spacing-xs);
}

/* Product actions styling */
.wpca-product-actions {
    display: flex;
    gap: var(--wpca-spacing-sm);
    margin-top: var(--wpca-spacing-md);
}

.wpca-product-actions .wpca-btn-sm {
    flex: 1;
}

/* Warranty status dots */
.wpca-warranty-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: var(--wpca-spacing-xs);
}

.wpca-warranty-status.active .wpca-warranty-dot {
    background-color: var(--wpca-success);
}

.wpca-warranty-status.expired .wpca-warranty-dot {
    background-color: var(--wpca-danger);
}

/* Ensure equal button sizing in product actions */
.wpca-product-actions .wpca-btn-secondary.wpca-btn-sm,
.wpca-product-actions .wpca-btn-ghost.wpca-btn-sm {
    padding: var(--wpca-spacing-sm) var(--wpca-spacing-md) !important;
    font-size: 14px !important;
    min-height: 36px !important;
    line-height: 1.2 !important;
    font-weight: 500 !important;
}

/* Override ghost button border to match secondary */
.wpca-product-actions .wpca-btn-ghost {
    border: none !important;
    background-color: var(--wpca-bg-secondary) !important;
}

.wpca-product-actions .wpca-btn-ghost:hover {
    background-color: var(--wpca-gray-200) !important;
    border: none !important;
}

/* Product Detection Info */
.wpca-product-detected {
    color: #059669;
    font-weight: 500;
    display: block;
    margin-bottom: 4px;
}

.wpca-additional-serials {
    color: #0891b2;
    display: block;
    font-style: italic;
}

#product-info,
#edit-product-info {
    background: #f0fdf4;
    padding: 8px 12px;
    border-radius: 4px;
    margin-top: 8px;
    border: 1px solid #86efac;
}

/* Success Alert Box */
.wpca-alert {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 8px;
    margin: 16px 0;
}

.wpca-alert-success {
    background: #f0fdf4;
    border: 1px solid #86efac;
    color: #065f46;
}

.wpca-alert-icon {
    flex-shrink: 0;
    color: #10b981;
}

/** Hide Footer Login / Registration Buttons **/
#menu-main-menu-2 .wpca-auth-menu-item {
    display: none !important;
}

/* ============================================================
 * Inline product registration on signup (FoMa Customer Portal 1.1)
 * Lightweight, no nested containers. Each slot is a single row.
 * Vertical rhythm kept deliberately tight — the section sits inside
 * an already-crowded signup form.
 * ========================================================== */
/* Section heading restyled as a form-field-style label per client
 * feedback — light weight + explicit line-height, plus a red required-
 * asterisk (.required is defined further up at ~line 891).
 *
 * Color is #00001E to match Salient theme's body text colour (the var
 * --wpca-text-primary resolves to #000000 which is visibly different
 * from the form's actual text colour — confirmed in client review). */
.wpca-products-title {
    font-size: 18px;
    font-weight: 300;             /* "Light" — per client round 2 */
    line-height: 1.25;
    color: #00001E;
    letter-spacing: -0.01em;
    margin: 8px 0 6px;
}
.wpca-products-intro {
    font-size: 14px;
    color: #4b5563;
    margin: 0 0 12px;
    padding-bottom: 0;            /* defensive — no inherited padding */
    line-height: 1.4;
}
.wpca-product-slots {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0;
}
.wpca-product-slot { /* a single row, no border, no background */ }
.wpca-product-slot-row {
    display: grid;
    grid-template-columns: 1fr 180px auto;
    grid-template-areas: "serial date remove";
    gap: 10px;
    align-items: end;
}
.wpca-product-slot-serial { grid-area: serial; min-width: 0; }
.wpca-product-slot-date   { grid-area: date;   min-width: 0; }
.wpca-product-slot-remove { grid-area: remove; }
.wpca-product-slot-row .wpca-form-group {
    margin: 0;
}
.wpca-product-slot-row .wpca-form-group label {
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 2px;
}
.wpca-product-slot-row input {
    width: 100%;
    /* Pin every input in the slot row to the SAME height so the row
     * reads as a uniform strip. Chrome renders `<input type="date">`
     * 2px taller than text inputs by default (50px vs 48px) because
     * of its internal calendar control padding — explicit height +
     * border-box equalises both. */
    height: 50px;
    box-sizing: border-box;
}
/* Selector intentionally chained (`.wpca-product-slots .wpca-product-slot-remove`)
 * to beat Salient's dynamic stylesheet, which carries
 * `body[data-button-style^="rounded"] button { border-radius: 200px !important; }`
 * — specificity (0,1,2). The chained class selector here is (0,2,0),
 * which wins on the class count without us needing to fight !important. */
.wpca-product-slots .wpca-product-slot-remove {
    align-self: end;
    /* Matches the inputs' visual form: 50px square (= the inputs'
     * normalised height, see .wpca-product-slot-row input above),
     * 4px radius, same translucent background tint, 2px transparent
     * border so the focus-visible state can flip to the same blue
     * border the inputs use without shifting layout. */
    width: 50px;
    height: 50px;
    margin: 0;
    padding: 0;
    border: 2px solid transparent;
    background: rgba(0, 0, 0, 0.04);
    color: #6b7280;
    font-size: 22px;
    line-height: 1;
    border-radius: 4px !important;  /* Salient's site-wide override uses
                                       !important, so we have to also. */
    cursor: pointer;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: color .15s ease, background .15s ease, border-color .15s ease;
}
.wpca-product-slots .wpca-product-slot-remove:hover {
    color: #b91c1c;
    background: rgba(185, 28, 28, 0.08);
    border-color: rgba(185, 28, 28, 0.2);
}
.wpca-product-slots .wpca-product-slot-remove:focus-visible {
    outline: none;
    border-color: rgb(0, 128, 200);
}
.wpca-slot-status {
    display: block;
    margin-top: 8px;
    font-size: 13px;
    line-height: 1.35;
    word-break: break-word;
}
/* Hide the status line entirely when there's no text — saves ~18px
 * of empty space below every freshly-added slot. */
.wpca-slot-status:empty {
    display: none;
}
.wpca-slot-status.is-validating { color: #6b7280; }
.wpca-slot-status.is-valid      { color: #15803d; }
.wpca-slot-status.is-invalid    { color: #b91c1c; }
.wpca-products-actions {
    margin: 4px 0 12px;
}
/* The Add-product button is styled to mirror the Country Select2 trigger
 * (blue border, 10px radius, placeholder-gray text) and its highlighted
 * dropdown option on hover (solid blue fill, white text). Per client
 * feedback the button should read as part of the form's design language.
 *
 * Selector chain `.wpca-products-actions #wpca-add-product` gives
 * specificity (0,2,1), beating Salient's site-wide
 * `body[data-button-style^="rounded"] button { border-radius: 200px !important }`
 * (0,1,2) on class count. `!important` still required because Salient
 * uses it. Same pattern as commit daa54f5. */
.wpca-products-actions #wpca-add-product {
    /* Height pinned to 48px to match the email/text inputs + the new
     * Select2 trigger override below. `min-height: 48px` is needed because
     * the .wpca-btn base rule sets `min-height: 50px !important` which
     * otherwise floors us at 50. Padding-vertical: 0 + line-height 1.4
     * lets the browser vertically centre the label in the 48px box. */
    height: 48px !important;
    min-height: 48px !important;
    /* Padding matches the EFFECTIVE text-start of the Select2 trigger:
     * the trigger has padding 0 16px AND its inner
     * .select2-selection__rendered adds another 10px left padding,
     * so visible text starts ~26-27px from the trigger's edge. Setting
     * the button's padding to 26px L/R lines the "+ Add product" text
     * up with "Select a country" in the column above. */
    padding: 0 26px !important;
    border: 1px solid var(--wpca-primary) !important;
    border-radius: var(--wpca-radius-md) !important;
    background: var(--wpca-bg-primary) !important;
    color: #00001E !important;                       /* match Salient body colour */
    font-size: 16px !important;
    font-weight: 400 !important;
    line-height: 1.4 !important;
    width: auto !important;
    box-sizing: border-box !important;
    transition: background var(--wpca-transition-base),
                color var(--wpca-transition-base),
                border-color var(--wpca-transition-base),
                box-shadow var(--wpca-transition-base) !important;
}
.wpca-products-actions #wpca-add-product:hover,
.wpca-products-actions #wpca-add-product:focus-visible {
    background: var(--wpca-primary) !important;
    color: #fff !important;
    border-color: var(--wpca-primary) !important;
    outline: none !important;
}
/* The 3.5px outer ring is reserved for keyboard-focus only. On plain
 * mouse hover the button just flips colors — no halo. */
.wpca-products-actions #wpca-add-product:focus-visible {
    box-shadow: 0 0 0 3.5px rgba(0, 127, 197, 0.15) !important;
}

/* The Country Select2 trigger renders shorter (33px) than the text
 * inputs (48px) because Salient's data-fancy-form-rcs="1" rule sets
 * padding-top/bottom: 5px (longhand, specificity (0,3,1)) which beat
 * the plugin's earlier `padding: 13px 16px` shorthand override.
 *
 * Force height + zero-vertical padding so .select2-selection__rendered's
 * 46px line-height vertically centres in the 46px content area
 * (48 − 2px border). `padding: 0 16px !important` expands to longhand
 * padding-top/right/bottom/left, all with !important, so each beats
 * the Salient longhand pt/pb 5px individually. */
.wpca-form-group .select2-container--default .select2-selection--single {
    height: 48px !important;
    padding: 0 16px !important;
    box-sizing: border-box !important;
}
.wpca-form-group .select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 46px !important;          /* = 48 - 2px border */
}
.wpca-form-group .select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 100% !important;
    top: 0 !important;
}
/* When at least one slot is present, the "Add another product" pill
 * should sit clearly below the previous slot's status line, not crowd
 * it. Initial empty state keeps the tighter 4px so the button hugs
 * the intro paragraph. */
.wpca-product-slots:not(:empty) + .wpca-products-actions {
    margin-top: 18px;
}

/* Stack the slot row (serial + × on top, date full-width below) on
 * anything narrower than a real desktop. The auth container's
 * `width: 50vw` (line 127) keeps the form narrow well past the 768px
 * mobile breakpoint, so the 3-column desktop grid runs out of room
 * until ~1024vw. */
@media (max-width: 1023px) {
    .wpca-product-slot-row {
        grid-template-columns: 1fr auto;
        grid-template-areas:
            "serial remove"
            "date   date";
        column-gap: 8px;
        row-gap: 6px;
    }
}

/* True mobile (≤768): also fix two pre-existing portal layout bugs that
 * only manifest on phone widths.
 *
 * 1. `.wpca-portal-container` is `display: flex` with a single child set
 *    to `flex: 0 1 auto`, so the child shrinks to content min-width
 *    instead of filling. Force it to 100%.
 * 2. `.wpca-auth-container` has `width: 50vw` (line 127) — fine on
 *    desktop, catastrophic on a 375vw phone where it resolves to 187px
 *    and `margin: 0 auto` centers it with ~78px gutters each side.
 *    Override to 100% here only.
 */
@media (max-width: 768px) {
    .wpca-portal-content {
        width: 100%;
        flex: 1 1 100%;
    }
    .wpca-auth-container,
    .wpca-auth-container-wide {
        width: 100%;
    }
    /* The site's mobile rule bumps form-container padding to spacing-lg
     * (~32px). On a 375vw screen that costs ~64px of horizontal room and
     * crushes the slot grid. Reduce it. */
    .wpca-form-container {
        padding: 16px !important;
    }
    .wpca-product-slot-row input[type="text"],
    .wpca-product-slot-row input[type="date"] {
        font-size: 16px;  /* prevents iOS Safari zoom-on-focus */
    }
    /* The desktop #wpca-add-product rule already sets width: auto !important,
     * but keep the mobile-scoped override here as belt-and-braces in case
     * the desktop selector is ever weakened. */
    .wpca-products-actions #wpca-add-product {
        white-space: nowrap !important;
    }
}

/* Truncate long emails in admin tables (customers, customer-detail).
 * Full address stays in the DOM (screen readers + copy/paste) and in
 * the title attribute (mouse hover). */
.wpca-email-truncate {
    display: inline-block;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
}

/* ============================================================
 * Lucide icon base — used by FomaCustomerPortal\Utils\Icons.
 * Per-context sizing (e.g. .wpca-action-icon, .wpca-btn-icon)
 * lives on the wrapping/sibling rules elsewhere in this file.
 * ========================================================== */
.fcp-icon {
    vertical-align: middle;
    flex-shrink: 0;
}

/* ============================================================
 * Dashboard "Your products" / "Your account" card additions.
 * Both live inside the existing .wpca-dashboard-card wrappers —
 * we just add a header bar + compact product list + footer link
 * on top of the existing card styling.
 * ========================================================== */
.wpca-dashboard-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 12px;
}
.wpca-dashboard-card-header h3 {
    margin: 0;
}
.wpca-dashboard-card-cta {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 10px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    color: #1d4ed8;
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    line-height: 1.2;
    transition: background .15s ease, border-color .15s ease;
}
.wpca-dashboard-card-cta:hover {
    background: #f5f8ff;
    border-color: #c7d2fe;
}
.wpca-dashboard-card-footer-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 12px;
    font-size: 13px;
    color: #1d4ed8;
    text-decoration: none;
}
.wpca-dashboard-card-footer-link:hover {
    text-decoration: underline;
}

/* Compact vertical product list — each row a single anchor.
 * The !important on the list-reset is needed to beat Salient theme
 * rules that set padding-left + list-style: disc on UL elements
 * inside content areas. */
.wpca-product-list {
    list-style: none !important;
    margin: 0 -8px !important;       /* negative inline margin so hover bg
                                        can extend past the card padding */
    padding: 0 !important;
    display: flex;
    flex-direction: column;
}
.wpca-product-list-row {
    list-style: none !important;
    padding-left: 0 !important;
    margin-left: 0 !important;
    border-bottom: 1px solid #f0f1f3;
}
.wpca-product-list-row::marker { content: ''; }   /* kill the disc bullet */
.wpca-product-list-row::before { content: none; } /* and any pseudo-bullet */
.wpca-product-list-row:last-child {
    border-bottom: none;
}
.wpca-product-list-link {
    display: grid;
    grid-template-columns: 48px 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 10px 8px;               /* horizontal padding so the hover
                                        background reads as a real "row" */
    text-decoration: none;
    color: inherit;
    border-radius: 8px;
    transition: background .15s ease;
}
.wpca-product-list-link:hover {
    background: #f3f4f6;
}
.wpca-product-list-thumb {
    width: 48px;
    height: 48px;
    border-radius: 6px;
    overflow: hidden;
    background: #f3f4f6;
    flex-shrink: 0;
}
.wpca-product-list-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.wpca-product-list-body {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.wpca-product-list-title {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
    color: #111827;
    /* clamp to 2 lines so rows align consistently */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.wpca-product-list-serial {
    font-size: 11px;
    color: #6b7280;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    word-break: break-all;
}

.wpca-product-list-empty {
    text-align: center;
    padding: 16px 8px;
    color: #6b7280;
}
.wpca-product-list-empty .fcp-icon {
    color: #d1d5db;
    margin-bottom: 8px;
}
.wpca-product-list-empty p {
    font-size: 13px;
    margin: 0 0 12px;
}

/* Warranty pill — reused on both /product-registration and the new
 * dashboard compact list. Three states for granular signalling. */
.wpca-warranty-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
    width: fit-content;
}
.wpca-warranty-pill .wpca-warranty-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}
.wpca-warranty-pill.is-active   { color: #15803d; background: #ecfdf5; }
.wpca-warranty-pill.is-soon     { color: #b45309; background: #fffbeb; }
.wpca-warranty-pill.is-expired  { color: #b91c1c; background: #fef2f2; }

/* Replacement for the old hand-drawn image placeholder (product-detail
 * + product-registration). Centres the lucide `image` glyph in a soft
 * grey square. */
.wpca-product-image-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: #d1d5db;
    background: #f3f4f6;
}

@media (max-width: 768px) {
    /* On narrow viewports the pill can wrap below the title to keep the
     * row readable. Shift to a stacked layout. */
    .wpca-product-list-link {
        grid-template-columns: 48px 1fr;
        grid-template-areas:
            "thumb body"
            "thumb pill";
        row-gap: 4px;
    }
    .wpca-product-list-thumb { grid-area: thumb; align-self: start; }
    .wpca-product-list-body  { grid-area: body; }
    .wpca-product-list-link > .wpca-warranty-pill { grid-area: pill; justify-self: start; }
}