/**
 * Super Conditional Login - Frontend Styles
 */

/* Login Form Wrapper */
.scl-login-form-wrapper {
    max-width: 400px;
    margin: 0 auto;
}

.scl-login-form {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Form Groups */
.scl-form-group {
    margin-bottom: var(--field-gap, 20px);
}

.scl-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.scl-form-group input[type="text"],
.scl-form-group input[type="tel"],
.scl-form-group input[type="email"],
.scl-form-group input[type="password"] {
    width: 100%;
    box-sizing: border-box;
    transition: border-color 0.3s;
}

.scl-form-group input:focus {
    outline: none;
    border-color: #0073aa;
}

/* Phone Input */
.scl-phone-input-wrapper {
    display: flex;
    gap: 8px;
}

.scl-country-code {
    display: inline-flex;
    align-items: center;
    padding: 12px 16px;
    font-weight: 600;
    white-space: nowrap;
    border: 1px solid;
}

.scl-phone-input-wrapper input[type="tel"] {
    flex: 1;
}

/* OTP Inputs */
.scl-otp-inputs {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 15px;
}

.scl-otp-digit {
    width: 45px;
    height: 50px;
    text-align: center;
    font-size: 20px;
    font-weight: 600;
}

.scl-otp-actions {
    text-align: center;
    margin-top: 15px;
}

.scl-resend-otp {
    background: none;
    border: none;
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
}

.scl-resend-otp:hover {
    text-decoration: none;
}

.scl-resend-otp:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Email Links */
.scl-email-links {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    font-size: 13px;
}

.scl-email-links a {
    text-decoration: none;
}

.scl-email-links a:hover {
    text-decoration: underline;
}

/* Switch Method */
.scl-switch-method {
    text-align: center;
    margin-top: var(--field-gap, 15px);
    font-size: 14px;
}

.scl-switch-method a {
    text-decoration: none;
}

.scl-switch-method a:hover {
    text-decoration: underline;
}

/* Messages */
.scl-message {
    padding: 12px;
    margin-bottom: var(--field-gap, 20px);
    border-radius: 4px;
    font-size: 14px;
}

.scl-message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.scl-message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.scl-message.info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Submit Button */
.scl-login-submit {
    transition: background-color 0.3s, transform 0.1s;
}

.scl-login-submit:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.scl-login-submit:active {
    transform: translateY(0);
}

.scl-login-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Login Button Widget */
.scl-login-button-wrapper {
    position: relative;
    display: inline-block;
}

.scl-login-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    transition: all 0.3s;
}

.scl-login-button:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.scl-login-button-icon {
    display: inline-flex;
    align-items: center;
}

.scl-user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: #ffffff;
    border: 1px solid #dddddd;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 180px;
    z-index: 1000;
}

.scl-user-dropdown ul {
    list-style: none;
    margin: 0;
    padding: 8px 0;
}

.scl-user-dropdown li {
    margin: 0;
    padding: 0;
}

.scl-user-dropdown a {
    display: block;
    padding: 10px 16px;
    color: #333333;
    text-decoration: none;
    transition: background-color 0.2s;
}

.scl-user-dropdown a:hover {
    background-color: #f5f5f5;
}

/* Loading State */
.scl-loading {
    position: relative;
    pointer-events: none;
}

.scl-loading::after {
    content: "";
    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: #ffffff;
    border-radius: 50%;
    animation: scl-spin 0.6s linear infinite;
}

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

/* Responsive */
@media (max-width: 480px) {
    .scl-login-form-wrapper {
        max-width: 100%;
        padding: 0 15px;
    }

    .scl-otp-digit {
        width: 38px;
        height: 45px;
        font-size: 18px;
    }

    .scl-email-links {
        flex-direction: column;
        gap: 8px;
    }
}

/* Accessibility */
.scl-form-group input:focus,
.scl-login-button:focus,
.scl-otp-digit:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* Hide/Show Classes */
.scl-hidden {
    display: none !important;
}

.scl-visible {
    display: block !important;
}

/* Profile Completion Form */
.scl-profile-completion {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.scl-profile-completion .scl-form-header {
    text-align: center;
    margin-bottom: 30px;
}

.scl-profile-completion .scl-form-header h3 {
    margin: 0 0 10px 0;
    font-size: 24px;
    font-weight: 600;
    color: #333;
}

.scl-profile-completion .scl-form-header p {
    margin: 0;
    color: #666;
    font-size: 14px;
}

.scl-profile-completion .required {
    color: #d63638;
    margin-left: 2px;
}

.scl-profile-completion .scl-field-description {
    margin: 5px 0 0 0;
    font-size: 13px;
    color: #666;
    font-style: italic;
}
