/* Wolve Loyalty Signup Form Styles */

:root {
    --wolve-bg-dark: #333333;
    --wolve-text-main: #ffffff;
    --wolve-input-bg: #ffffff;
    --wolve-accent-mint: #3de2c0;
    --wolve-accent-gold: #d4af37;
    --wolve-consent-text: #666666;
    --wolve-border-color: #e0e0e0;
    --wolve-error-color: #ff4444;
    --wolve-success-color: #4caf50;
}

.wolve-loyalty-signup-form-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);
}

.wolve-signup-title {
    color: var(--wolve-text-main);
    font-size: 28px;
    margin: 0 0 10px 0;
    text-align: center;
}

.wolve-signup-description {
    color: #666;
    font-size: 16px;
    text-align: center;
    margin: 0 0 25px 0;
}

.wolve-signup-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.wolve-form-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.wolve-form-field label {
    color: var(--wolve-text-main);
    font-weight: 500;
    font-size: 14px;
}

.wolve-form-field label .required {
    color: var(--wolve-error-color);
    margin-left: 4px;
}

.wolve-form-field input[type="text"],
.wolve-form-field input[type="email"],
.wolve-form-field input[type="tel"],
.wolve-form-field select {
    padding: 12px 15px;
    border: 1px solid var(--wolve-border-color);
    border-radius: 4px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: var(--wolve-input-bg);
}

/* Normalize select appearance across browsers */
.wolve-form-field select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    /* Custom dropdown arrow */
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23666' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px;
    padding-right: 40px;
    cursor: pointer;
}

.wolve-form-field input:focus,
.wolve-form-field select:focus {
    outline: none;
    border-color: var(--wolve-accent-mint);
    box-shadow: 0 0 0 3px rgba(61, 226, 192, 0.1);
}

.wolve-form-field input.error,
.wolve-form-field select.error {
    border-color: var(--wolve-error-color);
}

/* Checkbox styling */
.wolve-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1.5;
}

.wolve-checkbox-label input[type="checkbox"] {
    margin-top: 3px;
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--wolve-accent-mint);
}

.wolve-checkbox-label span {
    flex: 1;
    color: #666;
}

/* Error messages */
.wolve-field-error {
    color: var(--wolve-error-color);
    font-size: 12px;
    margin-top: -4px;
    display: none;
}

.wolve-field-error.show {
    display: block;
}

/* Messages container */
.wolve-messages {
    margin-bottom: 20px;
    padding: 15px;
    border-radius: 4px;
    display: none;
}

.wolve-messages.success {
    background: rgba(76, 175, 80, 0.1);
    border: 1px solid var(--wolve-success-color);
    color: var(--wolve-success-color);
    display: block;
}

.wolve-messages.error {
    background: rgba(255, 68, 68, 0.1);
    border: 1px solid var(--wolve-error-color);
    color: var(--wolve-error-color);
    display: block;
}

/* Marketing consent notice */
.wolve-marketing-consent {
    margin: 15px 0 10px 0;
    font-size: 13px;
    color: var(--wolve-consent-text);
    text-align: center;
    opacity: 0.9;
}

/* Submit button */
.wolve-form-submit {
    margin-top: 10px;
}

.wolve-signup-button {
    width: 100%;
    padding: 14px 20px;
    background: var(--wolve-accent-mint);
    color: #ffffff;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.wolve-signup-button:hover {
    background: var(--wolve-accent-gold);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.wolve-signup-button:active {
    transform: translateY(0);
}

.wolve-signup-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Loading spinner */
.wolve-spinner {
    animation: rotate 2s linear infinite;
    width: 20px;
    height: 20px;
}

.wolve-spinner .path {
    stroke: var(--wolve-bg-dark);
    stroke-linecap: round;
    animation: dash 1.5s ease-in-out infinite;
}

@keyframes rotate {
    100% {
        transform: rotate(360deg);
    }
}

@keyframes dash {
    0% {
        stroke-dasharray: 1, 150;
        stroke-dashoffset: 0;
    }
    50% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -35;
    }
    100% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -124;
    }
}

/* Responsive design */
@media (max-width: 768px) {
    .wolve-loyalty-signup-form-container {
        margin: 20px;
        padding: 20px;
    }
    
    .wolve-signup-title {
        font-size: 24px;
    }
    
    .wolve-form-field input[type="text"],
    .wolve-form-field input[type="email"],
    .wolve-form-field input[type="tel"],
    .wolve-form-field select {
        font-size: 16px; /* Prevent zoom on iOS */
    }
}

/* Dark theme support */
@media (prefers-color-scheme: dark) {
    .wolve-loyalty-signup-form-container {
        background: var(--wolve-bg-dark);
        color: var(--wolve-text-main);
    }
    
    .wolve-signup-title {
        color: var(--wolve-text-main);
    }
    
    .wolve-signup-description {
        color: #aaa;
    }
    
    .wolve-form-field label {
        color: var(--wolve-text-main);
    }
    
    .wolve-form-field input[type="text"],
    .wolve-form-field input[type="email"],
    .wolve-form-field input[type="tel"],
    .wolve-form-field select {
        background: var(--wolve-input-bg);
        color: var(--wolve-text-main);
        border-color: #555;
    }
    
    .wolve-checkbox-label span {
        color: #ccc;
    }
}

/* Fix iOS Safari making the selected option text blue */
.wolve-form-field select {
    -webkit-text-fill-color: var(--wolve-text-main); /* iOS override */
  }
  
  .wolve-form-field select option,
  .wolve-form-field select option:checked {
    color: var(--wolve-text-main);
  }
  
  /* Optional: style the disabled placeholder option */
  .wolve-form-field select option[disabled][value=""],
  .wolve-form-field select option[disabled]:first-child {
    color: #9aa0a6; /* a muted grey for "Select Country" */
  }