/* --- Keep previous Root/Body/Container styles --- */
:root {
    --bg-level-1: #F0EEE9; 
    --bg-level-2: #FDFCFB; 
    --bg-input:   #F5F4F1; 
    --primary-terracota: #D96C55;
    --primary-hover:     #C55A44;
    --success-green:     #4A7C59; 
    --text-main:  #2D2A26;
    --text-muted: #85807A;
    --border-subtle: rgba(0,0,0,0.06);

    --shadow-inset: inset 0 2px 4px rgba(0, 0, 0, 0.06), 
                    inset 0 1px 2px rgba(0, 0, 0, 0.04),
                    0 1px 0 rgba(255, 255, 255, 1); 
    
    --shadow-float: 0 20px 40px -5px rgba(45, 42, 38, 0.1), 
                    0 10px 15px -3px rgba(45, 42, 38, 0.05),
                    inset 0 1px 0 rgba(255, 255, 255, 0.8);

    --btn-shadow: 0 4px 6px rgba(217, 108, 85, 0.25),
                  inset 0 1px 0 rgba(255, 255, 255, 0.2);

    --radius-lg: 24px;
    --radius-md: 12px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-level-1);
    color: var(--text-main);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.container { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 24px; max-width: 100%; }

/* Card Transitions */
.card {
    background-color: var(--bg-level-2);
    width: 100%;
    max-width: 420px;
    padding: 40px 32px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-float);
    position: relative;
    overflow: visible; 
    transition: max-width 0.8s cubic-bezier(0.22, 1, 0.36, 1),padding 0.6s ease;
}

.card.expanded { max-width: 680px; }

/* Header */
.card-header { margin-bottom: 32px; text-align: center; }
.logo-mark {
    width: 48px; height: 48px;
    background: linear-gradient(135deg, var(--primary-terracota), #E68E7A);
    border-radius: 12px; margin: 0 auto 16px auto;
    box-shadow: 0 4px 12px rgba(217, 108, 85, 0.3);
}
.card-header h1 { font-size: 1.5rem; font-weight: 700; margin-bottom: 8px; }
.card-header p { color: var(--text-muted); font-size: 0.95rem; }

/* Slider */
.slider-viewport { width: 100%; overflow: hidden; border-radius: var(--radius-lg); }
.slider-track { display: flex; width: 200%; transition: transform 0.8s cubic-bezier(0.22, 1, 0.36, 1); }
.slide { width: 50%; flex-shrink: 0; padding: 4px; display: flex; flex-direction: column; }

/* Inputs */
.input-group { margin-bottom: 20px; }
label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 8px; margin-left: 4px; }
.req { color: var(--primary-terracota); }

input {
    width: 100%; padding: 14px 16px; font-size: 1rem; border: none; border-radius: var(--radius-md);
    background-color: var(--bg-input); color: var(--text-main); font-family: inherit;
    box-shadow: var(--shadow-inset); transition: all 0.2s ease;
}
input:focus { outline: none; background-color: #fff; box-shadow: inset 0 1px 2px rgba(0,0,0,0.05), 0 0 0 3px rgba(217, 108, 85, 0.15); }

/* Custom Dropdown */
.custom-dropdown { position: relative; width: 100%; margin-bottom: 24px; font-family: 'Inter', sans-serif; }
.dropdown-trigger {
    width: 100%; padding: 14px 16px; font-size: 1rem; font-weight: 500; border-radius: var(--radius-md);
    background-color: var(--bg-input); color: var(--text-muted); box-shadow: var(--shadow-inset);
    cursor: pointer; display: flex; justify-content: space-between; align-items: center; transition: all 0.2s;
}
.dropdown-trigger:hover { background-color: #fff; }
.dropdown-trigger.active { background-color: #fff; color: var(--text-main); }
.dropdown-arrow { font-size: 0.8rem; opacity: 0.6; transition: transform 0.3s; }
.dropdown-trigger.open .dropdown-arrow { transform: rotate(180deg); }

.dropdown-options {
    position: absolute; top: 110%; left: 0; width: 100%; background-color: #fff; border-radius: var(--radius-md);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1), 0 0 0 1px rgba(0,0,0,0.05); z-index: 100;
    opacity: 0; visibility: hidden; transform: translateY(-10px); transition: all 0.2s cubic-bezier(0.25, 1, 0.5, 1);
    max-height: 250px; overflow-y: auto;
}
.dropdown-trigger.open + .dropdown-options { opacity: 1; visibility: visible; transform: translateY(0); }
.dropdown-option { padding: 12px 16px; cursor: pointer; transition: background 0.1s; display: flex; align-items: center; gap: 8px; font-size: 0.95rem; }
.dropdown-option:hover { background-color: var(--bg-level-1); }
.dropdown-option span { font-size: 1.1rem; }

/* --- ACCORDION CREDENTIAL CARDS --- */
#credentialsList { display: flex; flex-direction: column; gap: 12px; margin-bottom: 24px; }

.credential-card {
    background: #fff;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    overflow: hidden; 
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
    /* By default, collapsed cards are slightly transparent */
    opacity: 0.85; 
}

/* Open state is fully opaque */
.credential-card.is-open {
    opacity: 1;
    border-color: rgba(0,0,0,0.1);
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.credential-header {
    display: flex; align-items: center; gap: 12px;
    padding: 16px 20px;
    cursor: pointer;
    background: transparent;
    transition: background 0.2s;
    user-select: none;
}
.credential-header:hover { background-color: var(--bg-level-1); }

.service-icon {
    width: 32px; height: 32px; background-color: var(--bg-level-1); border-radius: 8px;
    display: flex; align-items: center; justify-content: center; font-size: 1.2rem;
}
.service-title { font-weight: 600; font-size: 0.95rem; flex-grow: 1; }

/* The X remove button */
.remove-btn {
    background: none; border: none; color: var(--text-muted);
    font-size: 1.4rem; line-height: 1; cursor: pointer; padding: 4px;
    margin-left: 8px; opacity: 0.4; z-index: 2; transition: all 0.2s;
}
.remove-btn:hover { opacity: 1; color: var(--primary-terracota); transform: scale(1.1); }

.credential-body {
    padding: 0 20px; max-height: 0; overflow: hidden; opacity: 0;
    transition: all 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}

.credential-card.is-open .credential-body {
    padding-bottom: 20px; max-height: 500px; opacity: 1;
}

/* --- THE WIGGLE ANIMATION --- */
@keyframes shake {
    0% { transform: translateX(0); }
    25% { transform: translateX(-4px) rotate(-1deg); }
    50% { transform: translateX(4px) rotate(1deg); }
    75% { transform: translateX(-2px); }
    100% { transform: translateX(0); }
}

.credential-card.shake-it {
    animation: shake 0.6s ease-in-out;
}

/* Buttons */
.button-row { display: flex; gap: 12px; margin-top: 12px; }
.cta-button {
    width: 100%; padding: 16px; margin-top: 12px; background-color: var(--primary-terracota);
    color: white; font-size: 1rem; font-weight: 600; border: none; border-radius: var(--radius-md);
    cursor: pointer; box-shadow: var(--btn-shadow); transition: transform 0.1s ease, background-color 0.2s;
}
.cta-button:hover { background-color: var(--primary-hover); transform: translateY(-1px); }
.cta-button.loading { background-color: var(--text-muted); pointer-events: none; }

.secondary-button {
    width: 30%; padding: 16px; margin-top: 12px; background-color: transparent;
    color: var(--text-muted); font-size: 1rem; font-weight: 600; border: 1px solid transparent;
    border-radius: var(--radius-md); cursor: pointer; transition: all 0.2s;
}
.secondary-button:hover { background-color: var(--bg-level-1); color: var(--text-main); }

/* Success */
.success-view { display: none; flex-direction: column; align-items: center; text-align: center; padding: 20px 0; animation: fadeIn 0.5s ease; }
.success-icon {
    width: 64px; height: 64px; background-color: var(--success-green); color: white;
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-size: 2rem; margin-bottom: 24px; box-shadow: 0 10px 20px rgba(74, 124, 89, 0.3);
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding: 14px 16px;
    font-size: 1rem;
    border: none;
    border-radius: var(--radius-md);
    background-color: var(--bg-input);
    color: var(--text-main);
    box-shadow: var(--shadow-inset);
    cursor: pointer;
    transition: all 0.2s ease;
}
select:focus {
    outline: none;
    background-color: #fff;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.05), 0 0 0 3px rgba(217, 108, 85, 0.15);
}


/* --- NEW: Unified Phone Input Styling --- */

/* The wrapper creates the "Depth" look (Shadow + Background) */
.input-wrapper-merged {
    display: flex;
    align-items: center;
    width: 100%;
    background-color: var(--bg-input);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-inset);
    transition: all 0.2s ease;
    border: 1px solid transparent; /* Prepare for focus state */
}

/* Focus state for the WHOLE wrapper */
.input-wrapper-merged:focus-within {
    background-color: #fff;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.05), 0 0 0 3px rgba(217, 108, 85, 0.15);
}

/* The Country Select (Transparent & Clean) */
.country-select {
    appearance: none;
    -webkit-appearance: none;
    background-color: transparent;
    border: none;
    padding: 14px 0 14px 16px; /* Padding left only */
    font-size: 1rem;
    color: var(--text-main);
    cursor: pointer;
    font-weight: 500;
    max-width: 110px;
    outline: none; /* Focus handled by wrapper */
    box-shadow: none; /* Remove default shadow */
}

/* The Phone Input (Transparent & Fills space) */
.phone-input {
    flex-grow: 1;
    border: none;
    background-color: transparent;
    padding: 14px 16px;
    font-size: 1rem;
    color: var(--text-main);
    outline: none;
    box-shadow: none; /* Remove default shadow */
    font-family: 'Inter', sans-serif;
}

/* The vertical divider line */
.input-divider {
    width: 1px;
    height: 24px;
    background-color: rgba(0,0,0,0.1);
    margin: 0 4px;
}

/* Fix placeholder color */
.phone-input::placeholder {
    color: var(--text-muted);
    opacity: 0.7;
}


