/**
 * Create Account & Welcome Component Styles
 */

/* Create Header */
.mtune-create-header {
    text-align: center;
    margin-bottom: var(--mtune-space-xl);
}

.mtune-create-title {
    font-family: var(--mtune-font-display);
    font-size: var(--mtune-text-2xl);
    font-weight: 700;
    color: var(--mtune-text-primary);
    margin-bottom: var(--mtune-space-sm);
}

.mtune-create-subtitle {
    font-size: var(--mtune-text-sm);
    color: var(--mtune-text-secondary);
}

/* Form Row Grid */
.mtune-form-row-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--mtune-space-md);
}

/* Required/Optional Labels */
.mtune-form-group label .required {
    color: var(--mtune-error);
}

.mtune-form-group label .optional {
    color: var(--mtune-text-muted);
    font-weight: 400;
    font-size: var(--mtune-text-xs);
}

/* Input Hints */
.mtune-input-hint {
    font-size: var(--mtune-text-xs);
    color: var(--mtune-text-muted);
    margin-top: var(--mtune-space-xs);
}

/* Username Status */
.mtune-username-status {
    display: block;
    margin-bottom: var(--mtune-space-xs);
    font-weight: 500;
}

.mtune-username-status.valid {
    color: var(--mtune-success);
}

.mtune-username-status.invalid {
    color: var(--mtune-error);
}

.mtune-username-status.checking {
    color: var(--mtune-text-tertiary);
}

/* Input validation states */
#mtune-reg-username.valid {
    border-color: var(--mtune-success);
}

#mtune-reg-username.invalid {
    border-color: var(--mtune-error);
}

/* Password Match Status */
.mtune-password-match-status {
    font-size: var(--mtune-text-xs);
    margin-top: var(--mtune-space-xs);
    font-weight: 500;
}

.mtune-password-match-status.match {
    color: var(--mtune-success);
}

.mtune-password-match-status.no-match {
    color: var(--mtune-error);
}

/* Phone Input Styling */
#mtune-create-account-screen .mtune-auth-panel .iti {
    width: 100%;
    --iti-path-flags-1x: url('https://cdn.jsdelivr.net/npm/intl-tel-input@19.2.16/build/img/flags.webp');
    --iti-path-flags-2x: url('https://cdn.jsdelivr.net/npm/intl-tel-input@19.2.16/build/img/flags@2x.webp');
    --iti-path-globe-1x: url('https://cdn.jsdelivr.net/npm/intl-tel-input@19.2.16/build/img/globe.webp');
    --iti-path-globe-2x: url('https://cdn.jsdelivr.net/npm/intl-tel-input@19.2.16/build/img/globe@2x.webp');
}

#mtune-create-account-screen .mtune-auth-panel .iti input,
#mtune-create-account-screen .mtune-auth-panel .iti input[type="tel"] {
    width: 100%;
    padding: var(--mtune-space-md);
    padding-left: 90px;
    font-family: var(--mtune-font-primary);
    font-size: var(--mtune-text-base);
    color: var(--mtune-text-primary);
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--mtune-radius-md);
    transition: all var(--mtune-transition-fast);
    height: 52px;
}

#mtune-create-account-screen .mtune-auth-panel .iti input:focus,
#mtune-create-account-screen .mtune-auth-panel .iti input[type="tel"]:focus {
    outline: none;
    border-color: var(--mtune-primary);
    background: rgba(0, 0, 0, 0.4);
    box-shadow: 0 0 0 3px rgba(var(--mtune-primary-rgb), 0.2);
}

#mtune-create-account-screen .mtune-auth-panel .iti__selected-dial-code {
    color: var(--mtune-text-primary);
}

#mtune-create-account-screen .mtune-auth-panel .iti__arrow {
    border-top-color: var(--mtune-text-secondary);
}

/* Dropdown container - intl-tel-input v19 */
.iti__dropdown-content {
    background: var(--mtune-dark-200) !important;
    border: 1px solid var(--mtune-glass-border) !important;
    border-radius: var(--mtune-radius-md) !important;
    box-shadow: var(--mtune-shadow-lg) !important;
    z-index: 9999 !important;
    max-height: 300px !important;
    overflow: visible !important;
}

.iti__search-input {
    background: var(--mtune-dark-300) !important;
    border: none !important;
    border-bottom: 1px solid var(--mtune-glass-border) !important;
    color: var(--mtune-text-primary) !important;
    padding: 12px !important;
    width: 100% !important;
    font-size: 14px !important;
    box-sizing: border-box !important;
}

.iti__search-input::placeholder {
    color: var(--mtune-text-muted) !important;
}

.iti__search-input:focus {
    outline: none !important;
    background: var(--mtune-dark-400) !important;
}

/* Country list scrollable area */
.iti__country-list {
    background: var(--mtune-dark-200) !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    max-height: 200px !important;
    overflow-y: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
}

.iti__country-list::-webkit-scrollbar {
    width: 6px;
}

.iti__country-list::-webkit-scrollbar-track {
    background: var(--mtune-dark-300);
}

.iti__country-list::-webkit-scrollbar-thumb {
    background: var(--mtune-glass-border);
    border-radius: var(--mtune-radius-full);
}

.iti__country {
    padding: 10px 12px !important;
    display: flex !important;
    align-items: center !important;
    cursor: pointer !important;
}

.iti__country:hover,
.iti__country--highlight {
    background: var(--mtune-glass-bg-hover) !important;
}

.iti__country-name {
    color: var(--mtune-text-primary) !important;
    font-size: 14px !important;
}

.iti__dial-code {
    color: var(--mtune-text-tertiary) !important;
    font-size: 14px !important;
}

.iti__flag-box {
    margin-right: 8px !important;
}

/* Selected flag button */
.iti__selected-country {
    background: transparent !important;
    padding: 0 8px !important;
}

.iti__selected-country:hover {
    background: var(--mtune-glass-bg) !important;
}

/* Ensure dropdown is not clipped */
#mtune-create-account-screen .mtune-auth-panel .mtune-form-group {
    overflow: visible;
}

#mtune-create-account-screen .mtune-auth-panel .iti {
    position: relative;
}

/* Body-level dropdown container (when dropdownContainer: document.body is used) */
.iti--container {
    position: fixed !important;
    z-index: 99999 !important;
}

.iti--container .iti__dropdown-content {
    background: var(--mtune-dark-200, #1A1A1A) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 16px !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25) !important;
    overflow: hidden !important;
}

.iti--container .iti__search-input {
    background: #121212 !important;
    border: none !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: #ffffff !important;
    padding: 12px !important;
    width: 100% !important;
    font-size: 14px !important;
    box-sizing: border-box !important;
}

.iti--container .iti__search-input:focus {
    outline: none !important;
    background: #0d0d0d !important;
}

.iti--container .iti__search-input::placeholder {
    color: rgba(255, 255, 255, 0.3) !important;
}

.iti--container .iti__country-list {
    background: transparent !important;
    max-height: 200px !important;
    overflow-y: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
}

.iti--container .iti__country-list::-webkit-scrollbar {
    width: 6px;
}

.iti--container .iti__country-list::-webkit-scrollbar-track {
    background: #121212;
}

.iti--container .iti__country-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 9999px;
}

.iti--container .iti__country {
    padding: 10px 12px !important;
    cursor: pointer !important;
}

.iti--container .iti__country:hover,
.iti--container .iti__country--highlight {
    background: rgba(255, 255, 255, 0.08) !important;
}

.iti--container .iti__country-name {
    color: #ffffff !important;
    font-size: 14px !important;
}

.iti--container .iti__dial-code {
    color: rgba(255, 255, 255, 0.5) !important;
    font-size: 14px !important;
}

/* Terms Checkbox */
#mtune-create-account-screen .mtune-auth-panel .mtune-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: var(--mtune-space-sm);
    cursor: pointer;
    font-size: var(--mtune-text-sm);
    color: var(--mtune-text-secondary);
    line-height: 1.5;
}

#mtune-create-account-screen .mtune-auth-panel .mtune-checkbox-label input[type="checkbox"] {
    display: none;
}

#mtune-create-account-screen .mtune-auth-panel .mtune-checkbox-label .mtune-checkbox-custom {
    width: 20px;
    height: 20px;
    min-width: 20px;
    border: 2px solid var(--mtune-glass-border);
    border-radius: var(--mtune-radius-xs);
    background: var(--mtune-glass-bg);
    transition: all var(--mtune-transition-fast);
    position: relative;
    margin-top: 2px;
}

#mtune-create-account-screen .mtune-auth-panel .mtune-checkbox-label .mtune-checkbox-custom::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: 12px;
    height: 12px;
    background: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' xmlns='http://www.w3.org/2000/svg'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E") center/contain no-repeat;
    transition: transform var(--mtune-transition-spring);
}

#mtune-create-account-screen .mtune-auth-panel .mtune-checkbox-label input:checked + .mtune-checkbox-custom {
    background: linear-gradient(135deg, var(--mtune-primary), var(--mtune-accent));
    border-color: transparent;
}

#mtune-create-account-screen .mtune-auth-panel .mtune-checkbox-label input:checked + .mtune-checkbox-custom::after {
    transform: translate(-50%, -50%) scale(1);
}

#mtune-create-account-screen .mtune-auth-panel .mtune-checkbox-label a {
    color: var(--mtune-accent);
}

#mtune-create-account-screen .mtune-auth-panel .mtune-checkbox-label a:hover {
    text-decoration: underline;
}

/* reCAPTCHA v3 Badge - Hidden (branding text shown instead per Google's requirements) */
.grecaptcha-badge {
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* reCAPTCHA Branding Text (required when hiding badge) */
.mtune-recaptcha-branding {
    font-size: 11px;
    color: var(--mtune-text-muted);
    text-align: center;
    margin-top: var(--mtune-space-md);
    line-height: 1.5;
}

.mtune-recaptcha-branding a {
    color: var(--mtune-text-tertiary);
}

.mtune-recaptcha-branding a:hover {
    color: var(--mtune-text-secondary);
}

/* Create Button Success State */
.mtune-btn-create .btn-success {
    display: none;
    position: absolute;
    width: 28px;
    height: 28px;
}

.mtune-btn-create.success .btn-text {
    visibility: hidden;
}

.mtune-btn-create.success .btn-loader {
    display: none;
}

.mtune-btn-create.success .btn-success {
    display: flex;
    align-items: center;
    justify-content: center;
}

.mtune-btn-create .btn-success .success-spinner {
    position: absolute;
    width: 28px;
    height: 28px;
    animation: spin 1s linear infinite;
    color: white;
}

.mtune-btn-create .btn-success .success-check {
    position: absolute;
    width: 16px;
    height: 16px;
    color: white;
    animation: checkPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.mtune-btn-create.success {
    background: linear-gradient(135deg, var(--mtune-success), #00a843);
    box-shadow: var(--mtune-shadow-md), 0 0 40px rgba(0, 200, 83, 0.3);
    pointer-events: none;
}

/* Create Footer */
.mtune-create-footer {
    text-align: center;
    margin-top: var(--mtune-space-xl);
    font-size: var(--mtune-text-sm);
    color: var(--mtune-text-tertiary);
}

.mtune-create-footer a {
    color: var(--mtune-accent);
    font-weight: 500;
}

.mtune-create-footer a:hover {
    text-decoration: underline;
}

/* ======================= */
/* Welcome Screen Styles   */
/* ======================= */

.mtune-welcome-container {
    padding: var(--mtune-space-lg) 0;
}

/* Welcome Icon */
.mtune-welcome-icon {
    position: relative;
    width: 100px;
    height: 100px;
    margin: 0 auto var(--mtune-space-xl) auto;
}

.mtune-welcome-icon-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    border: 2px solid var(--mtune-accent);
    border-radius: 50%;
    opacity: 0.3;
    animation: welcomeRing 2s ease-out infinite;
}

.mtune-welcome-icon-ring:nth-child(2) {
    animation-delay: 0.5s;
}

@keyframes welcomeRing {
    0% {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 0.5;
    }
    100% {
        transform: translate(-50%, -50%) scale(1.5);
        opacity: 0;
    }
}

.mtune-welcome-icon-inner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--mtune-success), #00a843);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: welcomeIconPop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.mtune-welcome-icon-inner svg {
    width: 40px;
    height: 40px;
    color: white;
}

@keyframes welcomeIconPop {
    0% {
        transform: translate(-50%, -50%) scale(0);
    }
    60% {
        transform: translate(-50%, -50%) scale(1.1);
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
    }
}

/* Welcome Header */
.mtune-welcome-header {
    margin-bottom: var(--mtune-space-2xl);
}

.mtune-welcome-title {
    font-family: var(--mtune-font-display);
    font-size: var(--mtune-text-3xl);
    font-weight: 700;
    color: var(--mtune-text-primary);
    line-height: 1.3;
    margin-bottom: var(--mtune-space-md);
}

.mtune-gradient-text {
    background: linear-gradient(135deg, var(--mtune-primary), var(--mtune-accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.mtune-welcome-subtitle {
    font-size: var(--mtune-text-base);
    color: var(--mtune-text-secondary);
    line-height: 1.6;
}

.mtune-welcome-subtitle strong {
    color: var(--mtune-accent);
}

/* Welcome Features */
.mtune-welcome-features {
    display: flex;
    flex-direction: column;
    gap: var(--mtune-space-md);
    margin-bottom: var(--mtune-space-2xl);
    padding: 0 var(--mtune-space-md);
}

.mtune-welcome-feature {
    display: flex;
    align-items: center;
    gap: var(--mtune-space-md);
    padding: var(--mtune-space-md);
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--mtune-radius-sm);
    text-align: left;
    animation: featureSlideIn 0.5s ease-out backwards;
}

.mtune-welcome-feature:nth-child(1) { animation-delay: 0.2s; }
.mtune-welcome-feature:nth-child(2) { animation-delay: 0.3s; }
.mtune-welcome-feature:nth-child(3) { animation-delay: 0.4s; }

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

.mtune-welcome-feature-icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--mtune-primary), var(--mtune-accent));
    border-radius: var(--mtune-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.mtune-welcome-feature-icon svg {
    width: 22px;
    height: 22px;
    color: white;
}

.mtune-welcome-feature-text {
    display: flex;
    flex-direction: column;
}

.mtune-welcome-feature-text strong {
    font-size: var(--mtune-text-sm);
    font-weight: 600;
    color: var(--mtune-text-primary);
}

.mtune-welcome-feature-text span {
    font-size: var(--mtune-text-xs);
    color: var(--mtune-text-tertiary);
}

/* Enter Dashboard Button */
.mtune-enter-dashboard {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--mtune-space-sm);
    animation: buttonPulse 2s ease-in-out infinite;
}

@keyframes buttonPulse {
    0%, 100% {
        box-shadow: var(--mtune-shadow-md), var(--mtune-shadow-glow);
    }
    50% {
        box-shadow: var(--mtune-shadow-lg), 0 0 60px rgba(var(--mtune-primary-rgb), 0.4);
    }
}

/* Responsive */
@media (max-width: 639px) {
    .mtune-form-row-grid {
        grid-template-columns: 1fr;
    }

    .mtune-welcome-title {
        font-size: var(--mtune-text-2xl);
    }

    .mtune-welcome-feature {
        padding: var(--mtune-space-sm);
    }
}

/* Autofill Styling Override */
.mtune-create-account-form input:-webkit-autofill,
.mtune-create-account-form input:-webkit-autofill:hover,
.mtune-create-account-form input:-webkit-autofill:focus,
.mtune-create-account-form input:-webkit-autofill:active,
.mtune-create-account-form textarea:-webkit-autofill,
.mtune-create-account-form select:-webkit-autofill {
    -webkit-text-fill-color: #ffffff !important;
    box-shadow: 0 0 0 1000px rgba(0, 0, 0, 0.3) inset !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    transition: background-color 5000s ease-in-out 0s;
}

.mtune-create-account-form input:-webkit-autofill:focus {
    box-shadow: 0 0 0 1000px rgba(0, 0, 0, 0.4) inset !important;
    border: 1px solid var(--mtune-primary) !important;
}

