/* ==========================================================================
   Form Input Icons (.input-with-icon)
   Shared across contact, trial, and checkout forms
   ========================================================================== */

.input-with-icon {
    position: relative;
}

.input-with-icon > .ph {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1.125rem;
    pointer-events: none;
    z-index: 1;
    transition: color 0.2s ease;
}

.input-with-icon input,
.input-with-icon select {
    padding-left: 42px !important;
}

/* Icon color change on focus */
.input-with-icon:has(input:focus) > .ph,
.input-with-icon:has(select:focus) > .ph,
.input-with-icon:has(textarea:focus) > .ph {
    color: var(--accent-orange);
}

/* Textarea icon positioning (top-left) */
.input-with-icon.textarea-icon > .ph {
    top: 16px;
    transform: none;
}

.input-with-icon.textarea-icon textarea {
    padding-left: 42px !important;
}

/* Select dropdown arrow adjustment */
.input-with-icon select {
    background-position: right 14px center !important;
}

/* Forms with labels - icon positioned relative to input, not the whole container */
.trial-form .input-with-icon,
.contact-form .input-with-icon {
    display: flex;
    flex-direction: column;
}

.trial-form .input-with-icon > label,
.contact-form .input-with-icon > label {
    position: relative;
    margin-bottom: 8px;
}

.trial-form .input-with-icon > .ph,
.contact-form .input-with-icon > .ph {
    top: auto;
    bottom: 14px;
    transform: none;
}

/* Trial form icon styles */
.trial-form .input-with-icon > .ph {
    left: 16px;
}

.trial-form .input-with-icon input,
.trial-form .input-with-icon select {
    padding-left: 46px !important;
}

/* Contact form icon styles */
.contact-form .input-with-icon > .ph {
    left: 14px;
}

.contact-form .input-with-icon input,
.contact-form .input-with-icon select,
.contact-form .input-with-icon textarea {
    padding-left: 42px !important;
}

/* Contact form textarea icon */
.contact-form .input-with-icon.textarea-icon > .ph {
    bottom: auto;
    top: calc(100% - 120px);
}

/* ==========================================================================
   Adult Content Toggle
   ========================================================================== */

.adult-content-toggle {
    margin-top: 16px;
    margin-bottom: 16px;
}

.adult-content-toggle .toggle-container {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    transition: all 0.2s ease;
}

.adult-content-toggle .toggle-container:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.15);
}

.adult-content-toggle input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.adult-content-toggle .toggle-switch {
    position: relative;
    flex-shrink: 0;
    width: 44px;
    height: 24px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    transition: all 0.3s ease;
    margin-top: 2px;
}

.adult-content-toggle .toggle-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: var(--text-muted);
    border-radius: 50%;
    transition: all 0.3s ease;
}

.adult-content-toggle input[type="checkbox"]:checked + .toggle-switch {
    background: var(--accent-orange);
}

.adult-content-toggle input[type="checkbox"]:checked + .toggle-switch::after {
    transform: translateX(20px);
    background: white;
}

.adult-content-toggle .toggle-label-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.adult-content-toggle .toggle-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.adult-content-toggle .toggle-description {
    font-size: 12px;
    color: var(--text-muted);
}


/* Focus state for accessibility */
.adult-content-toggle input[type="checkbox"]:focus + .toggle-switch {
    box-shadow: 0 0 0 2px rgba(var(--accent-orange-rgb), 0.3);
}

/* Checkout page specific adjustments */
.checkout-form-v2 .adult-content-toggle {
    margin-top: 12px;
}

.checkout-form-v2 .adult-content-toggle .toggle-container {
    background: rgba(255, 255, 255, 0.02);
}

/* ==========================================================================
   MAC Address Field Styles
   ========================================================================== */

.mac-address-field {
    position: relative;
}

/* Keep MAC icon aligned with input (not helper text) */
.mac-address-field.input-with-icon > .ph {
    top: 24px;
    transform: translateY(-50%);
    font-size: 1rem;
}

/* Trial form has label above input, so icon needs a lower anchor */
.trial-form .mac-address-field.input-with-icon > .ph {
    top: 52px;
    bottom: auto;
    transform: translateY(-50%);
}

.mac-address-field input {
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', monospace;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.mac-address-field .form-helper {
    display: block;
    margin-top: 8px;
    padding-left: 2px;
    font-size: 11px;
    color: var(--text-muted);
}

/* Validation states */
.mac-address-field input:invalid:not(:placeholder-shown) {
    border-color: #ef4444;
}

.mac-address-field input:valid:not(:placeholder-shown) {
    border-color: #22c55e;
}

/* Trial page MAC address field */
.trial-form .mac-address-field {
    margin-bottom: 16px;
}

.trial-form .mac-address-field label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-primary);
}

.trial-form .mac-address-field .form-helper {
    color: var(--text-muted);
    font-size: 12px;
}

/* ==========================================================================
   Form Section Dividers
   ========================================================================== */

.form-section-divider {
    display: flex;
    align-items: center;
    margin: 24px 0 16px;
    gap: 12px;
}

.form-section-divider::before,
.form-section-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
}

.form-section-divider span {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    white-space: nowrap;
}

/* Trial form specific adjustments */
.trial-form .form-section-divider {
    margin: 20px 0 12px;
}

.trial-form .form-section-divider:first-of-type {
    margin-top: 8px;
}

/* Trial form toggle alignment fix */
.trial-form .form-row-inline {
    display: flex;
    align-items: stretch;
}

.trial-form .form-row-inline .form-group {
    flex: 1;
    margin-bottom: 0;
    display: flex;
    align-items: stretch;
}

.trial-form .form-row-inline .form-group select {
    flex: 1;
    height: 48px;
}

.trial-form .form-row-inline .adult-toggle-compact {
    flex: 1;
    margin-bottom: 0;
    display: flex;
    align-items: stretch;
}

.trial-form .form-row-inline .adult-toggle-compact .toggle-inline {
    flex: 1;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Ensure toggle text is centered with the switch */
.trial-form .toggle-inline .toggle-text {
    overflow: visible;
    text-overflow: clip;
    line-height: 1;
}
