/* ===== BRAND COLORS - BLUE & WHITE ===== */
:root {
    --primary: #0A66C2;
    --primary-dark: #084a8f;
    --primary-light: #e8f0fe;
    --accent: #3b82f6;
    --accent-light: #dbeafe;
    --bg: #f0f7ff;
    --text: #0F172A;
    --text-light: #475569;
    --border: #E5E7EB;
    --radius: 12px;
    --radius-sm: 8px;
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --shadow: 0 8px 25px rgba(10, 77, 140, 0.12);
    --shadow-hover: 0 12px 35px rgba(10, 77, 140, 0.18);
    --transition: all 0.3s ease;
    --off-white: #F8FAFC;
}

/* ===== RESET & BASE ===== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    padding: 20px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 720px;
    margin: 0 auto;
    padding: 0 15px;
}

/* ===== BACK TO LOGIN ===== */
.back-to-login {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 0;
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    border-radius: 8px;
    transition: var(--transition);
    margin-bottom: 16px;
}

.back-to-login:hover {
    color: var(--primary-dark);
}

/* ===== FORM CARD ===== */
.form-card {
    background: #ffffff;
    border-radius: var(--radius);
    padding: clamp(30px, 5vw, 50px);
    box-shadow: var(--shadow);
    border: 1px solid rgba(10, 77, 140, 0.08);
    width: 100%;
}

.form-card h2 {
    font-size: clamp(1.8rem, 3vw, 2.4rem);
    color: var(--primary);
    font-weight: 700;
    margin-bottom: 6px;
}

.subtitle {
    color: var(--text-light);
    margin-bottom: 30px;
    font-size: clamp(1rem, 1.5vw, 1.1rem);
}

/* ===== PROGRESS STEPS ===== */
.progress-steps {
    display: flex;
    justify-content: space-between;
    margin-bottom: 35px;
    position: relative;
}

.progress-steps::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 10%;
    right: 10%;
    height: 2px;
    background: var(--border);
    transform: translateY(-50%);
    z-index: 1;
}

.step {
    flex: 1;
    text-align: center;
    position: relative;
    z-index: 2;
}

.step-circle {
    width: clamp(36px, 4vw, 42px);
    height: clamp(36px, 4vw, 42px);
    border-radius: 50%;
    background: white;
    border: 2.5px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 8px;
    font-weight: 700;
    font-size: clamp(14px, 1.2vw, 17px);
    color: var(--text-light);
    transition: var(--transition);
}

.step.active .step-circle {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    box-shadow: 0 4px 15px rgba(10, 77, 140, 0.25);
}

.step.completed .step-circle {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

.step-label {
    font-size: clamp(0.75rem, 1.1vw, 0.9rem);
    color: var(--text-light);
    font-weight: 600;
}

.step.active .step-label {
    color: var(--primary);
    font-weight: 700;
}

/* ===== FORM SECTIONS ===== */
.form-section {
    display: none;
    animation: fadeIn 0.4s ease;
}

.form-section.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== FORM GRID ===== */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(18px, 2vw, 24px);
}

.form-group {
    margin-bottom: clamp(14px, 1.5vw, 22px);
}

.full-width {
    grid-column: 1 / -1;
}

/* ===== LABELS ===== */
label {
    display: block;
    font-size: clamp(0.95rem, 1.1vw, 1.05rem);
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text);
}

.required::after {
    content: " *";
    color: var(--error);
}

.optional {
    font-weight: 400;
    color: var(--text-light);
    font-size: 0.9em;
}

/* ===== INPUTS ===== */
input, select, textarea {
    width: 100%;
    padding: clamp(14px, 1.5vw, 18px) clamp(16px, 1.5vw, 20px);
    border-radius: var(--radius-sm);
    border: 2px solid var(--border);
    font-size: clamp(1rem, 1.1vw, 1.05rem);
    font-family: inherit;
    transition: var(--transition);
    background: var(--off-white);
    color: var(--text);
    min-height: clamp(50px, 5vw, 56px);
}

input:focus, select:focus, textarea:focus {
    outline: 2px solid var(--primary);
    outline-offset: -1px;
    border-color: transparent;
}

input.error, select.error, textarea.error {
    border-color: var(--error);
}

input.error:focus, select.error:focus, textarea.error:focus {
    outline: 2px solid var(--error);
    outline-offset: -1px;
    border-color: transparent;
}

textarea {
    min-height: 100px;
    resize: vertical;
}

select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
    appearance: none;
}

/* ===== PHONE INPUT WITH COUNTRY CODE PREFIX ===== */
.phone-input-wrapper {
    display: flex;
    align-items: stretch;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--off-white);
    transition: var(--transition);
    overflow: hidden;
}

.phone-input-wrapper:focus-within {
    outline: 2px solid var(--primary);
    outline-offset: -1px;
    border-color: transparent;
}

.phone-input-wrapper.error {
    border-color: var(--error);
}

.phone-input-wrapper.error:focus-within {
    outline: 2px solid var(--error);
    outline-offset: -1px;
    border-color: transparent;
}

.country-code-prefix {
    display: flex;
    align-items: center;
    padding: 0 12px;
    font-weight: 600;
    color: var(--text);
    background: var(--bg);
    border-right: 1px solid var(--border);
    font-size: clamp(0.95rem, 1.1vw, 1.05rem);
    min-width: 50px;
    justify-content: center;
    white-space: nowrap;
    user-select: none;
}

.country-code-prefix:empty {
    display: none;
}

.phone-input-wrapper input {
    border: none !important;
    outline: none !important;
    background: transparent !important;
    padding: clamp(14px, 1.5vw, 18px) clamp(14px, 1.5vw, 20px);
    min-height: clamp(50px, 5vw, 56px);
    flex: 1;
    font-size: clamp(1rem, 1.1vw, 1.05rem);
    font-family: inherit;
    color: var(--text);
}

.phone-input-wrapper input:focus {
    outline: none !important;
    border: none !important;
    box-shadow: none !important;
}

/* ===== PASSWORD TOGGLE ===== */
.input-with-icon {
    position: relative;
}

.input-with-icon input {
    padding-right: clamp(44px, 4vw, 56px);
}

.input-with-icon i {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: var(--transition);
    font-size: 1.2rem;
    z-index: 10;
    background: transparent;
    pointer-events: auto;
}

.input-with-icon i:hover {
    background: rgba(10, 77, 140, 0.08);
    color: var(--primary);
}

/* ===== PASSWORD STRENGTH ===== */
.password-strength {
    height: 4px;
    border-radius: 2px;
    margin-top: 10px;
    background: var(--border);
    overflow: hidden;
}

.strength-bar {
    height: 100%;
    width: 0%;
    transition: width 0.4s ease, background 0.4s ease;
}

.strength-weak { background: var(--error); }
.strength-fair { background: var(--warning); }
.strength-good { background: var(--accent); }
.strength-strong { background: var(--success); }

.strength-text {
    font-size: clamp(0.8rem, 0.9vw, 0.9rem);
    margin-top: 6px;
    text-align: right;
    color: var(--text-light);
}

/* ===== CHAR COUNT ===== */
.char-count {
    text-align: right;
    font-size: 0.8rem;
    color: var(--text-light);
    margin-top: 4px;
}

/* ===== CHECKBOX ===== */
.checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 14px;
}

.checkbox-group input[type="checkbox"] {
    width: clamp(20px, 2vw, 22px);
    height: clamp(20px, 2vw, 22px);
    min-width: clamp(20px, 2vw, 22px);
    min-height: clamp(20px, 2vw, 22px);
    padding: 0;
    margin-top: 2px;
    cursor: pointer;
    border-radius: 5px;
    border: 2px solid var(--border);
    transition: var(--transition);
    appearance: none;
    position: relative;
    background: white;
    flex-shrink: 0;
}

.checkbox-group input[type="checkbox"]:checked {
    background: var(--primary);
    border-color: var(--primary);
}

.checkbox-group input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: clamp(14px, 1.2vw, 16px);
    font-weight: 700;
}

.checkbox-group input[type="checkbox"]:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.checkbox-group label {
    margin-bottom: 0;
    font-weight: 400;
    font-size: clamp(0.95rem, 1.1vw, 1.05rem);
    cursor: pointer;
    color: var(--text);
    line-height: 1.5;
}

.terms-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

.terms-link:hover {
    text-decoration: underline;
    color: var(--primary-dark);
}

/* ===== ERROR MESSAGES ===== */
.error-message {
    color: var(--error);
    font-size: clamp(0.85rem, 0.9vw, 0.95rem);
    margin-top: 6px;
    display: none;
    animation: fadeIn 0.3s ease;
}

/* ===== API RESPONSE ===== */
.api-response {
    padding: 16px 20px;
    border-radius: var(--radius-sm);
    margin-bottom: 22px;
    font-size: clamp(0.95rem, 1vw, 1rem);
    display: none;
    animation: fadeIn 0.3s ease;
}

.api-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border-left: 4px solid var(--success);
}

.api-error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
    border-left: 4px solid var(--error);
}

/* ===== SUCCESS / ERROR MESSAGES ===== */
.success-message, .error-message-general {
    padding: 18px 22px;
    border-radius: var(--radius-sm);
    margin-bottom: 22px;
    display: none;
    animation: fadeIn 0.3s ease;
    font-size: clamp(0.95rem, 1vw, 1rem);
}

.success-message {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border-left: 4px solid var(--success);
}

.error-message-general {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
    border-left: 4px solid var(--error);
}

/* ===== FORM SUMMARY ===== */
.form-summary {
    background: var(--primary-light);
    border-radius: var(--radius-sm);
    padding: clamp(18px, 2vw, 24px);
    margin-bottom: 25px;
    border: 1px solid rgba(10, 77, 140, 0.1);
}

.summary-item {
    display: flex;
    padding: 10px 0;
    border-bottom: 1px solid rgba(10, 77, 140, 0.08);
    gap: 12px;
}

.summary-item:last-child {
    border-bottom: none;
}

.summary-label {
    font-weight: 600;
    min-width: 130px;
    color: var(--primary-dark);
    font-size: clamp(0.95rem, 1vw, 1rem);
    flex-shrink: 0;
}

.summary-item > div:last-child {
    font-size: clamp(0.95rem, 1vw, 1rem);
    word-break: break-word;
}

/* ===== FORM NAVIGATION ===== */
.form-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: clamp(30px, 3vw, 45px);
    padding-top: clamp(24px, 2vw, 30px);
    border-top: 1px solid var(--border);
    gap: 15px;
    flex-wrap: wrap;
}

/* ===== BUTTONS ===== */
.btn {
    padding: clamp(14px, 1.5vw, 18px) clamp(28px, 3vw, 40px);
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: clamp(1rem, 1.1vw, 1.1rem);
    cursor: pointer;
    transition: var(--transition);
    border: none;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 52px;
    flex: 1;
}

@media (min-width: 769px) {
    .btn { flex: 0 1 auto; min-width: 120px; }
}

.btn:active { transform: scale(0.97); }

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 15px rgba(10, 77, 140, 0.25);
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(10, 77, 140, 0.35);
}

.btn-secondary {
    background: white;
    color: var(--primary);
    border: 2px solid var(--border);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--primary-light);
    border-color: var(--primary);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* ===== COUNTRY DROPDOWN ===== */
.country-dropdown {
    position: absolute;
    z-index: 1000;
    max-height: 200px;
    overflow-y: auto;
    background: white;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    width: 100%;
    margin-top: 4px;
    left: 0;
    display: none;
    top: 100%;
}

.country-dropdown::-webkit-scrollbar {
    width: 5px;
}

.country-dropdown::-webkit-scrollbar-thumb {
    background: var(--primary-light);
    border-radius: 3px;
}

.country-option {
    padding: clamp(10px, 1.2vw, 16px) clamp(14px, 1.5vw, 22px);
    cursor: pointer;
    transition: background 0.2s ease;
    border-bottom: 1px solid var(--border);
    font-size: clamp(0.9rem, 1vw, 1rem);
    min-height: 42px;
    display: flex;
    align-items: center;
}

.country-option:hover, .country-option.active {
    background-color: var(--primary-light);
}

/* ===== LOADING SPINNER ===== */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

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

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    body { padding: 10px; }
    .container { padding: 0; }
    .form-card { padding: clamp(18px, 3vw, 28px); border-radius: 10px; }
    .form-grid { grid-template-columns: 1fr; gap: 8px; }
    .form-navigation { flex-direction: column-reverse; gap: 10px; margin-top: 18px; padding-top: 16px; }
    .form-navigation .btn { width: 100%; flex: 1; justify-content: center; }
    .btn { min-height: 44px; padding: 12px 16px; font-size: 0.95rem; }
    input, select, textarea { font-size: 16px !important; min-height: 42px; padding: 10px 12px; }
    input[type="date"] { font-size: 16px !important; min-height: 42px; padding: 8px 10px; }
    .step-circle { width: 30px; height: 30px; font-size: 12px; }
    .step-label { font-size: 0.6rem; }
    .country-dropdown { max-height: 160px; }
}

@media (max-width: 480px) {
    body { padding: 6px; }
    .form-card { padding: 14px 10px; border-radius: 8px; }
    .form-card h2 { font-size: 1.4rem; }
    .subtitle { font-size: 0.9rem; margin-bottom: 14px; }
    input, select, textarea { font-size: 16px !important; min-height: 40px; padding: 8px 10px; }
    input[type="date"] { font-size: 16px !important; min-height: 40px; padding: 6px 8px; }
    .btn { min-height: 40px; padding: 10px 14px; font-size: 0.9rem; }
    .step-circle { width: 26px; height: 26px; font-size: 10px; }
    .step-label { font-size: 0.5rem; }
    .country-dropdown { max-height: 140px; }
    .country-option { padding: 8px 12px; font-size: 0.85rem; min-height: 34px; }
}