/* GradeSkill Freelancer Form specific styles */

/* Form Wrapper */
.gs-form-wrap {
    max-width: 920px;
    margin: 40px auto;
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--bg2);
    box-shadow: var(--shadow);
}

.gs-form-head {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 24px;
}

.gs-form-head h2 {
    margin: 0;
    font-size: 24px;
    line-height: 1.2;
    color: var(--text);
}

.gs-form-head p {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 14px;
}

/* Progress Bar */
.gs-progress {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: flex-end;
    min-width: 200px;
}

.gs-progress .bar {
    width: 140px;
    height: 8px;
    background: var(--line);
    border-radius: 999px;
    overflow: hidden;
}

.gs-progress .bar>i {
    display: block;
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #3b82f6, #3b82f6, #22c55e);
    transition: width 0.3s ease;
}

.gs-progress .label {
    font-size: 12px;
    color: var(--muted);
    white-space: nowrap;
}

/* Note Box */
.gs-note {
    margin: 10px 0 24px;
    padding: 16px;
    border-radius: 12px;
    background: rgba(43, 212, 183, .08);
    /* Mint tint */
    border: 1px solid rgba(43, 212, 183, .25);
    color: var(--text);
    font-size: 14px;
}

/* Pills inside note */
.gs-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
    padding: 6px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--bg);
    margin-right: 8px;
    margin-bottom: 6px;
}

/* Form structure */
.gs-fieldset {
    border: 0;
    padding: 0;
    margin: 0;
    display: none;
}

.gs-fieldset[aria-hidden="false"] {
    display: block;
}

.gs-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    align-items: start;
}

@media (max-width: 760px) {
    .gs-form-head {
        flex-direction: column;
    }

    .gs-progress {
        justify-content: flex-start;
    }

    .gs-grid {
        grid-template-columns: 1fr;
    }
}

/* Fields */
.gs-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    position: relative;
}

.gs-grid>.gs-field>label:first-child {
    min-height: 2.6em;
}

.gs-field label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

.gs-field .hint {
    font-size: 12px;
    color: var(--muted);
    margin-top: 2px;
}

.gs-field input,
.gs-field select,
.gs-field textarea {
    width: 100%;
    padding: 12px 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    outline: none;
    font-size: 14px;
    background: var(--input);
    color: var(--text);
}

.gs-field textarea {
    min-height: 110px;
    resize: vertical;
}

.gs-field input:focus,
.gs-field select:focus,
.gs-field textarea:focus {
    border-color: rgba(59, 130, 246, .55);
    box-shadow: 0 0 0 4px var(--focus);
}

/* Validation Error Styles */
.gs-field input.error,
.gs-field select.error,
.gs-field textarea.error {
    border-color: rgba(239, 68, 68, .35);
    box-shadow: 0 0 0 1px rgba(239, 68, 68, .35);
}

.gs-field input.error:focus,
.gs-field select.error:focus,
.gs-field textarea.error:focus {
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.2);
}

.error-text {
    color: #c74a4a;
    font-size: 12px;
    margin-top: 4px;
    /* animation: fadeIn 0.2s; */
}

/* intl-tel-input Overrides — Theme Integration */
.iti {
    width: 100%;

    /* Override library CSS vars to match app theme */
    --iti-hover-color: var(--chip);
    --iti-border-color: var(--line);
    --iti-dialcode-color: var(--muted);
    --iti-dropdown-bg: var(--bg2);
    --iti-arrow-color: var(--text);
}

.iti input.iti__tel-input,
.iti input.iti__tel-input[type=tel] {
    width: 100%;
    padding: 12px 12px 12px 52px;
    border: 1px solid var(--line);
    border-radius: 12px;
    outline: none;
    font-size: 14px;
    background: var(--input);
    color: var(--text);
    font-family: inherit;
}

.iti input.iti__tel-input:focus,
.iti input.iti__tel-input[type=tel]:focus {
    border-color: rgba(59, 130, 246, .55);
    box-shadow: 0 0 0 4px var(--focus);
}

.iti input.iti__tel-input.error {
    border-color: rgba(239, 68, 68, .35);
    box-shadow: 0 0 0 1px rgba(239, 68, 68, .35);
}

.iti input.iti__tel-input.error:focus {
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.2);
}

/* Country selector button */
.iti__country-container {
    border-radius: 12px 0 0 12px;
}

.iti__selected-country-primary {
    padding: 0 6px 0 12px !important;
}

/* Dropdown content wrapper */
.iti .iti__dropdown-content {
    border-radius: 12px;
    box-shadow: var(--shadow);
    overflow: hidden;
    margin-top: 4px;
}

/* Country list */
.iti .iti__country-list {
    max-height: 220px;
}

.iti .iti__country {
    color: var(--text);
    font-size: 13px;
    padding: 8px 12px;
}

.iti .iti__country-name {
    color: var(--text);
}

.iti .iti__dial-code {
    color: var(--muted);
}

/* Selected dial code */
.iti .iti__selected-dial-code {
    color: var(--text);
    font-size: 14px;
}

/* Search input inside dropdown */
.iti .iti__search-input {
    background: var(--input) !important;
    color: var(--text) !important;
    border: 1px solid var(--line) !important;
    border-radius: 8px !important;
    padding: 8px 10px !important;
    font-size: 13px !important;
    outline: none !important;
    margin: 6px !important;
    width: calc(100% - 12px) !important;
}

.iti .iti__search-input:focus {
    border-color: rgba(59, 130, 246, .55) !important;
    box-shadow: 0 0 0 4px var(--focus) !important;
}

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

@media (max-width: 760px) {
    .iti {
        width: 100%;
    }
}

.gs-divider {
    margin: 24px 0;
    height: 1px;
    background: var(--line);
    border: 0;
}

/* Acknowledgements */
.gs-ack-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 8px;
}

@media (max-width: 760px) {
    .gs-ack-grid {
        grid-template-columns: 1fr;
    }
}

.gs-check {
    display: grid;
    grid-template-columns: 18px 1fr;
    /* Checkbox column is fixed 18px */
    gap: 12px;
    align-items: start;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--card);
    /* Slight bg for cards */
    width: 100%;
    cursor: pointer;
}

/* Fix for error text inside grid card */
.gs-check .error-text {
    grid-column: 1 / -1;
    /* Make error span full width */
    margin-top: 8px;
}

.gs-check:hover {
    background: var(--card2);
}

.gs-check input {
    margin-top: 4px;
    accent-color: var(--pri);
}

.gs-check b {
    display: block;
    font-size: 13px;
    line-height: 1.25;
    color: var(--text);
}

.gs-check span {
    display: block;
    font-size: 12px;
    color: var(--muted);
    margin-top: 4px;
    line-height: 1.35;
}

/* Actions */
.gs-actions {
    display: flex;
    gap: 10px;
    justify-content: space-between;
    align-items: center;
    margin-top: 24px;
}

.gs-actions .left,
.gs-actions .right {
    display: flex;
    gap: 10px;
    align-items: center;
}

.gs-btn {
    padding: 11px 20px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: var(--card);
    color: var(--text);
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s;
}

.gs-btn:hover {
    background: var(--card2);
}

.gs-btn.primary {
    border: none;
    background: linear-gradient(135deg, var(--pri), var(--acc));
    color: white;
    /* Always white text on primary btn */
    box-shadow: 0 4px 12px rgba(59, 130, 246, .2);
}

.gs-btn.primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(59, 130, 246, .25);
}

.gs-btn:disabled {
    opacity: .55;
    cursor: not-allowed;
    transform: none;
}

/* Messages */
.gs-error {
    display: none;
    margin-top: 12px;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid rgba(239, 68, 68, .35);
    background: rgba(239, 68, 68, .08);
    color: var(--text);
    font-size: 13px;
}

.gs-success {
    display: none;
    margin-top: 12px;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid rgba(34, 197, 94, .35);
    background: rgba(34, 197, 94, .08);
    color: var(--text);
    font-size: 13px;
}