/* Vipps Signup Form Styles */

:root {
    --vipps-orange: #FF6900;
    --vipps-orange-hover: #E55D00;
}

/* Container inherits from main signup form styles */
.wolve-vipps-signup-container {
    max-width: 600px;
    margin: 30px auto;
    padding: 30px;
    background: var(--wolve-bg-dark);
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Tab Navigation */
.wolve-vipps-tabs {
    display: flex;
    gap: 0;
    margin: 20px 0 30px 0;
    border-bottom: 2px solid var(--wolve-border-color);
}

.wolve-tab-button {
    flex: 1;
    padding: 12px 20px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--wolve-text-main);
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0.7;
    margin-bottom: -2px;
}

.wolve-tab-button:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.05);
}

.wolve-tab-button.active {
    opacity: 1;
    border-bottom-color: var(--wolve-accent-mint);
    color: var(--wolve-accent-mint);
}

/* Vipps tab specific active styling */
.wolve-tab-button[data-tab="vipps"].active {
    border-bottom-color: var(--vipps-orange);
    color: var(--vipps-orange);
}

/* Tab Content */
.wolve-tab-content {
    animation: fadeIn 0.3s ease;
}

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

/* Vipps form specific - simpler layout */
.wolve-vipps-form {
    max-width: 400px;
    margin: 0 auto;
}

.wolve-vipps-form .wolve-form-field {
    margin-bottom: 20px;
}

/* Center the submit button */
.wolve-vipps-form .wolve-form-submit {
    text-align: center;
}

/* ---------- Phone input group (centered) ---------- */
/* Center the entire field contents */
.wolve-vipps-form .wolve-form-field {
    display: flex !important;
    flex-direction: column;
    align-items: center;              /* centers children on the cross-axis */
}

/* Keep label full width if you want it left-aligned text */
.wolve-vipps-form .wolve-form-field > label {
    width: 100%;
    max-width: 350px;
    text-align: left;
}

/* Make the phone group a compact block and center it */
.wolve-vipps-form .wolve-phone-input-group {
    display: flex !important;             /* regular flex to span width */
    gap: 10px;
    align-items: stretch;
    width: 100% !important;               /* make group span full width */
    max-width: 350px !important;          /* control total width */
    margin: 0 auto !important;            /* center horizontally */
}

/* Country code */
.wolve-country-code-select {
    width: 135px;                        /* Increased width for flag + code */
    min-width: 135px;                    /* Prevent shrinking */
    flex-shrink: 0;
    padding: 10px 12px;                  /* Slightly more horizontal padding */
    font-size: 16px;
    border: 1px solid var(--wolve-border-color);
    border-radius: 4px;
    background-color: var(--wolve-input-bg);
    color: var(--wolve-text-main);
    white-space: nowrap;                 /* Prevent text wrapping */
    overflow: hidden;                    /* Hide overflow */
    text-overflow: ellipsis;            /* Show ellipsis if still too long */
}

/* Phone number input - Override base styles with higher specificity */
.wolve-vipps-form .wolve-phone-input-group input[type="tel"] {
    flex: 1 1 auto !important;           /* expand to fill remaining space */
    width: 100% !important;              /* take full width of flex item */
    min-width: 0 !important;             /* prevent overflow in flex */
    max-width: none !important;          /* remove any max-width constraints */
    box-sizing: border-box !important;   /* include padding in width calculation */
}

/* Vipps form button styling - Orange */
#vipps-tab .wolve-signup-button {
    background: var(--vipps-orange);
}

#vipps-tab .wolve-signup-button:hover {
    background: var(--vipps-orange-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 105, 0, 0.3);
}

/* Elements inherit all styles from main signup form */

/* Responsive Design */
@media (max-width: 768px) {
    .wolve-vipps-signup-container {
        margin: 20px;
        padding: 20px;
    }
    .wolve-tab-button {
        font-size: 14px;
        padding: 10px 15px;
    }
    
    /* Stack phone inputs vertically on mobile */
    .wolve-vipps-form .wolve-phone-input-group {
        flex-direction: column !important;  /* Stack vertically */
        gap: 15px;                          /* Add space between stacked elements */
    }
    
    /* Make country code selector full width on mobile */
    .wolve-country-code-select {
        width: 100% !important;             /* Full width when stacked */
        min-width: unset !important;        /* Remove min-width constraint */
        max-width: none !important;         /* Remove max-width constraint */
    }
    
    /* Ensure phone input is also full width */
    .wolve-vipps-form .wolve-phone-input-group input[type="tel"] {
        width: 100% !important;
    }
}

/* Vipps States Styling */
.vipps-states {
    text-align: center;
    padding: 40px 20px;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Loader Animation */
.loader {
    height: 30px;
    aspect-ratio: 2.5;
    --_g: no-repeat radial-gradient(farthest-side, var(--vipps-orange) 90%, #0000);
    background: var(--_g), var(--_g), var(--_g), var(--_g);
    background-size: 20% 50%;
    animation: l43 1s infinite linear;
    margin: 0 auto 20px;
}

@keyframes l43 {
    0%     {background-position: calc(0*100%/3) 50%, calc(1*100%/3) 50%, calc(2*100%/3) 50%, calc(3*100%/3) 50%}
    16.67% {background-position: calc(0*100%/3) 0,    calc(1*100%/3) 50%, calc(2*100%/3) 50%, calc(3*100%/3) 50%}
    33.33% {background-position: calc(0*100%/3) 100%, calc(1*100%/3) 0,    calc(2*100%/3) 50%, calc(3*100%/3) 50%}
    50%    {background-position: calc(0*100%/3) 50%,  calc(1*100%/3) 100%, calc(2*100%/3) 0,    calc(3*100%/3) 50%}
    66.67% {background-position: calc(0*100%/3) 50%,  calc(1*100%/3) 50%,  calc(2*100%/3) 100%, calc(3*100%/3) 0}
    83.33% {background-position: calc(0*100%/3) 50%,  calc(1*100%/3) 50%,  calc(2*100%/3) 50%,  calc(3*100%/3) 100%}
    100%   {background-position: calc(0*100%/3) 50%,  calc(1*100%/3) 50%,  calc(2*100%/3) 50%,  calc(3*100%/3) 50%}
}

/* Loading State */
.vipps-loading-text {
    color: var(--wolve-text-main);
    font-size: 16px;
    margin: 0;
}

/* Success State */
.vipps-checkmark {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #4caf50;
    color: white;
    font-size: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    animation: scaleIn 0.3s ease;
}

@keyframes scaleIn {
    from { transform: scale(0); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}

.vipps-success-text {
    color: var(--wolve-text-main);
    font-size: 20px;
    font-weight: 600;
    margin: 0;
}

.vipps-success-text a {
    color: var(--wolve-accent-mint);
    text-decoration: underline;
    transition: all 0.3s ease;
}

.vipps-success-text a:hover {
    color: var(--wolve-accent-gold);
    text-decoration: none;
}

.vipps-greeting-text {
    color: var(--wolve-text-main);
    font-size: 24px;
    font-weight: 600;
    margin: 0;
}

.vipps-benefits-text {
    color: var(--wolve-text-main);
    font-size: 16px;
    margin: 15px 0 0 0;
    opacity: 0.9;
}

/* Error State */
.vipps-error-text {
    color: var(--wolve-text-main);
    font-size: 18px;
    margin: 0 0 20px 0;
}

.vipps-try-again-btn {
    padding: 12px 30px;
    background: var(--vipps-orange);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.vipps-try-again-btn:hover {
    background: var(--vipps-orange-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 105, 0, 0.3);
}

/* Dark theme support */
@media (prefers-color-scheme: dark) {
    .wolve-vipps-signup-container {
        background: var(--wolve-bg-dark);
        color: var(--wolve-text-main);
    }
    .wolve-tab-button { color: var(--wolve-text-main); }
    .wolve-tab-button:hover { background: rgba(255, 255, 255, 0.1); }
}
