/* Base Styles - Shared across all basic3pl pages */

/* ==================== CSS VARIABLES ==================== */
:root {
    /* Text */
    --text-primary: #191919;
    --text-secondary: #595959;
    --text-muted: rgba(89, 89, 89, 0.6);

    /* Base */
    --grey-300: #E0E0E0;
    --primary: #038CDB;
    --primary-dark: #00639C;
    --secondary-main: #0B1220;
    --secondary-dark: #000000;
    --primary-contrast: #FFFFFF;

    /* Interaction states */
    --primary-hover-bg: rgba(3, 140, 219, 0.12);
    --primary-selected-bg: rgba(0, 187, 255, 0.08);
    --primary-focus-bg: rgba(3, 140, 219, 0.12);
    --primary-outlined-border: rgba(3, 140, 219, 0.50);
    --tooltip-fill: rgba(11, 18, 32, 0.90);

    /* Alert / Feedback states */
    --error-main: #D32F2F;
    --error-content: #5F2120;
    --error-fill: #FDEDED;

    --warning-main: #ED6C02;
    --warning-content: #663C00;
    --warning-fill: #FFF4E5;

    --info-main: #0288D1;
    --info-content: #014361;
    --info-fill: #E5F6FD;

    --success-main: #4CAF50;
    --success-content: #1E4620;
    --success-fill: #EDF7ED;

    /* Input */
    --input-outlined-border: rgba(0, 0, 0, 0.23);
    --input-filled-bg: rgba(0, 0, 0, 0.06);
    --input-label-color: var(--text-secondary);

    /* Surface / Elevation */
    --surface-paper: #FFFFFF;
    --divider: rgba(0, 0, 0, 0.12);
}

/* ==================== FORM TYPOGRAPHY ==================== */
/* Section heading (h2) */
.section-heading {
    font-size: 18px;
    font-weight: bold;
    line-height: 26px;
    color: var(--text-secondary);
}

@media (min-width: 768px) {
    .section-heading {
        font-size: 19px;
    }
}

@media (min-width: 1024px) {
    .section-heading {
        font-size: 20px;
    }
}

/* Subsection heading (h3) */
.subsection-heading {
    font-size: 14px;
    font-weight: bold;
    line-height: 26px;
    color: var(--text-secondary);
}

/* Inline links within form label text (Terms of Use, Privacy Policy, etc.) */
.form-label-link {
    color: inherit;
    font-size: inherit;
    font-weight: inherit;
    font-family: inherit;
    line-height: inherit;
    letter-spacing: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color 0.2s ease;
}

.form-label-link:hover {
    color: var(--primary);
}

/* Help text / Description */
.help-text {
    font-size: 0.75rem; /* 12px */
    color: var(--text-muted);
    line-height: 1.66;
}

/* Paragraph description text */
.description-text {
    font-size: 16px;
    color: var(--text-muted);
    line-height: 24px;
    letter-spacing: 0.15px;
}

/* ==================== FORM CONTROLS ==================== */
/* Radio/Checkbox label */
.radio-label {
    margin-left: 0.5rem;
    font-size: 16px;
    line-height: 1.5;
    color: var(--text-primary);
    letter-spacing: 0.15px;
    cursor: pointer;
}

/* Secondary info text inside radio labels */
.radio-secondary-text {
    margin-left: 0.5rem;
    font-size: 13px;
    color: rgba(0, 0, 0, 0.38);
    font-weight: 400;
    letter-spacing: 0.1px;
}

/* Checkbox selection button */
.checkbox-button-label {
    display: block;
    cursor: pointer;
    background-color: var(--grey-300);
    border-radius: 0.25rem;
    padding: 6px 16px;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.5rem;
    color: var(--text-primary);
    letter-spacing: 0.4px;
    transition: all 0.2s;
}

.checkbox-button-label:hover {
    background-color: rgba(112, 217, 255, 0.15);
}

/* Peer-checked state (requires hidden checkbox with class "peer") */
input[type="checkbox"].peer:checked + .checkbox-button-label,
input[type="radio"].peer:checked + .checkbox-button-label {
    background-color: var(--primary);
    color: var(--primary-contrast);
    box-shadow: 0px 1px 10px 0px rgba(3,140,219,0.2),
                0px 4px 5px 0px rgba(3,140,219,0.15),
                0px 2px 4px -1px rgba(3,140,219,0.25);
}

/* Phone flag icon prefix */
.phone-flag-prefix {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
    color: var(--text-primary);
    line-height: 1.5;
    pointer-events: none;
    z-index: 10;
}

/* ==================== FIGMA-SPECIFIC STYLES ==================== */
.figma-input {
    border: 1px solid rgba(0, 0, 0, 0.23);
    border-radius: 4px;
    padding: 8px 12px;
    font-family: 'Roboto', sans-serif;
    font-size: 18px;
    line-height: 28px;
    color: #191919;
    width: 100%;
    height: 52px;
    transition: border-color 0.2s ease, border-width 0.2s ease;
    box-sizing: border-box;
}

.figma-input::placeholder {
    color: rgba(89, 89, 89, 0.6);
}

.figma-input:focus {
    outline: none;
    border-color: rgba(0, 0, 0, 0.23);
}

/* Divider matching Figma */
.figma-divider {
    height: 1px;
    background-color: rgba(0, 0, 0, 0.23);
    width: 100%;
    margin: 20px 0;
}

/* ==================== NAVIGATION TREE STYLES ==================== */
/* Navigation tree styles - matching Figma exact spacing */
.nav-tree-item {
    display: flex;
    align-items: center;
    padding: 0 8px;  /* py-0, px-8px from Figma */
}

.nav-tree-icon {
    width: 19px;
    height: 19px;
    margin-right: 4px;
    flex-shrink: 0;
}

.nav-tree-divider-container {
    display: flex;
    align-items: stretch;
    height: 100%;
    width: 19px;
    padding-right: 4px;
    flex-shrink: 0;
    overflow: hidden;
}

.nav-tree-divider {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: none;
    object-position: center;
}

/* ==================== LEGACY STYLES ==================== */
/* Legacy gradient background (keep for other pages) */
.gradient-bg {
    background-color: #1a1a2e;
    background-image: radial-gradient(circle at 10% 10%, rgba(255, 255, 255, 0.05) 0%, transparent 30%),
                      radial-gradient(circle at 80% 90%, rgba(255, 255, 255, 0.05) 0%, transparent 40%);
}

/* ==================== RADIO BUTTON STYLES ==================== */
/* Radio button styles - Custom Figma design */
input[type="radio"] {
    appearance: none;
    -webkit-appearance: none;
    width: 24px;
    height: 24px;
    border: 2px solid rgba(0, 0, 0, 0.54);
    border-radius: 50%;
    outline: none;
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
}

input[type="radio"]:checked {
    border-color: var(--primary);
    background-color: white;
}

input[type="radio"]:checked::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--primary);
}

input[type="radio"]:hover {
    border-color: rgba(0, 0, 0, 0.87);
}

input[type="radio"]:checked:hover {
    border-color: var(--primary-dark);
}

/* ==================== SELECTION BUTTON STYLES ==================== */
/* Selection button styles */
.selection-button:checked + label {
    background-color: #38bdf8;
    border-color: #38bdf8;
    color: white;
    font-weight: 600;
}

/* ==================== FORM INPUT STYLES ==================== */
/* Basic styling for form inputs */
input[type="text"],
input[type="email"],
input[type="password"],
select {
    display: block;
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    margin-bottom: 0.5rem;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
select:focus {
    outline: none;
    border-color: #38bdf8;
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.25);
}

/* ==================== FORM VALIDATION STYLES ==================== */

/* Field wrapper for validation */
.field-wrapper {
    position: relative;
}

/* ==================== ERROR MESSAGE STYLES ==================== */
/* Error summary (only shows non-field errors) */
.form-error-summary {
    background-color: var(--error-fill);
    border-left: 4px solid var(--error-main);
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 16px;
    animation: slideDown 0.3s ease-out;
}

.error-summary-text {
    font-family: 'Roboto', sans-serif;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.5;
    color: var(--error-content);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.error-summary-text::before {
    content: "⚠";
    font-size: 18px;
    flex-shrink: 0;
}

/* Field error message */
.field-error-message {
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    color: var(--error-main);
    margin: 6px 0 0 0;
    display: flex;
    align-items: flex-start;
    gap: 6px;
    animation: fadeIn 0.2s ease-out;
}

.field-error-message::before {
    content: "⚠";
    font-size: 14px;
    flex-shrink: 0;
    margin-top: 1px;
}

/* Background color for error inputs */
.bg-red-50 {
    background-color: var(--error-fill) !important;
}

/* ==================== ANIMATIONS ==================== */
/* Animation effects */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes spinner {
    to {
        transform: rotate(360deg);
    }
}

/* ==================== LOADING SPINNER ==================== */
/* Submit button loading spinner */
.submit-button {
    position: relative;
}

/* Hide the old SVG spinner when HTMX request is active */
.submit-button.htmx-request .loading-spinner {
    display: none;
}

/* Show CSS spinner during HTMX request */
.submit-button.htmx-request::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    margin-left: 8px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spinner 0.6s linear infinite;
    vertical-align: middle;
}

