/* ==========================================================================
   AGENCY / TECH STUDIO THEME PALETTE
   ========================================================================== */
:root {
    --primary-color: #0f172a;       /* Dark Indigo / Slate */
    --accent-vibrant: #6366f1;      /* Indigo / Electric Violet */
    --accent-glow: rgba(99, 102, 241, 0.25);
    --accent-pink: #ec4899;         /* Vibrant Pink Gradient Accent */
    
    --bg-gradient: radial-gradient(circle at 50% -20%, #eeeafe 0%, #f8fafc 60%, #e2e8f0 100%);
    --card-bg: rgba(255, 255, 255, 0.88);
    
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    
    --border-color: rgba(226, 232, 240, 0.8);
    --border-hover: #c7d2fe;
    
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 24px;
    
    --shadow-sm: 0 4px 12px rgba(15, 23, 42, 0.03);
    --shadow-agency: 0 20px 40px -15px rgba(99, 102, 241, 0.12), 0 10px 20px -5px rgba(0, 0, 0, 0.04);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
    background: var(--bg-gradient);
    color: var(--text-primary);
    line-height: 1.6;
    padding: 50px 15px;
    min-height: 100vh;
}

/* ==========================================================================
   AGENCY CONTAINER (CREATIVE GLASSMORPHISM)
   ========================================================================== */
.container {
    max-width: 880px;
    margin: 0 auto;
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: 45px 40px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-agency);
    border: 1px solid rgba(255, 255, 255, 0.9);
    position: relative;
    overflow: hidden;
}

/* Header Gradient Line */
.container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: linear-gradient(90deg, #6366f1 0%, #ec4899 50%, #8b5cf6 100%);
}

/* ==========================================================================
   HEADER AGENCY STYLE
   ========================================================================== */
.header {
    text-align: center;
    margin-bottom: 35px;
    padding-bottom: 25px;
    border-bottom: 1px solid var(--border-color);
}

.header h1 {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.6px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #0f172a 0%, #6366f1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header p {
    color: var(--text-secondary);
    font-size: 14.5px;
    font-weight: 500;
}

/* ==========================================================================
   DYNAMIC STEPPER GRID LAYOUT (WITH TEXT ECLIPSED / ELLIPSIS)
   ========================================================================== */
.stepper {
    display: grid;
    grid-template-columns: repeat(4, 1fr); 
    align-items: center;
    margin-bottom: 40px;
    gap: 10px;
    background: #f1f5f9;
    padding: 8px;
    border-radius: var(--radius-md);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
    box-sizing: border-box;
}

/* Pengaturan Layout Grid Berdasarkan Step Aktif */
.stepper.step-active-1 { grid-template-columns: 1fr auto auto auto; }
.stepper.step-active-2 { grid-template-columns: auto 1fr auto auto; }
.stepper.step-active-3 { grid-template-columns: auto auto 1fr auto; }
.stepper.step-active-4 { grid-template-columns: auto auto auto 1fr; }

.step-item {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 48px;
    padding: 0 12px;
    min-width: 48px;
    text-decoration: none;
    color: var(--text-secondary);
    background: #ffffff;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
    overflow: hidden; 
}

.step-item .step-icon {
    font-size: 22px;
    color: var(--text-muted);
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.step-item:hover {
    border-color: var(--accent-vibrant);
    color: var(--accent-vibrant);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px var(--accent-glow);
}

.step-item:hover .step-icon {
    color: var(--accent-vibrant);
}

/* Styling Menu Aktif (Yang Mendapat Porsi 1fr) */
.step-item.active {
    width: 100%;
    min-width: 0;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
    color: #ffffff;
    border-color: #312e81;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.25);
    padding: 0 14px;
}

.step-item.active .step-icon {
    color: #818cf8;
    transform: scale(1.05);
}

/* Text Eclipsed / Ellipsis */
.step-item.active .step-label {
    font-size: 13.5px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    letter-spacing: 0.3px;
}

/* ==========================================================================
   INPUTS & FORM GROUPS (ROUNDED & GLOW)
   ========================================================================== */
.section-title {
    font-size: 17px;
    font-weight: 800;
    color: var(--primary-color);
    margin: 35px 0 20px 0;
    padding-bottom: 10px;
    border-bottom: 2px dashed #e2e8f0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title .material-icons-outlined {
    color: var(--accent-vibrant);
    background: #e0e7ff;
    padding: 6px;
    border-radius: 8px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.full-width {
    grid-column: span 2;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

label {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-secondary);
}

input[type="text"],
input[type="date"],
input[type="time"],
input[type="url"],
select,
textarea {
    width: 100%;
    padding: 13px 18px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--text-primary);
    background-color: #ffffff;
    transition: all 0.25s ease;
}

input:hover, select:hover, textarea:hover {
    border-color: var(--border-hover);
    background-color: #fafafa;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--accent-vibrant);
    box-shadow: 0 0 0 4px var(--accent-glow);
    background-color: #ffffff;
}

textarea {
    resize: vertical;
    min-height: 95px;
}

/* ==========================================================================
   DYNAMIC ITEMS (DYNAMIC CARDS)
   ========================================================================== */
.dynamic-item {
    background: #ffffff;
    border: 1px solid var(--border-color);
    padding: 22px;
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    position: relative;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.dynamic-item:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.04);
}

.btn-add {
    background: #ffffff;
    color: var(--accent-vibrant);
    border: 2px dashed #c7d2fe;
    padding: 14px;
    width: 100%;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-weight: 700;
    font-size: 13.5px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.25s ease;
}

.btn-add:hover {
    background: #eeeafe;
    border-color: var(--accent-vibrant);
}

/* ==========================================================================
   FORM BUTTONS & ACTIONS (DESKTOP)
   ========================================================================== */
.form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 40px;
    padding-top: 25px;
    border-top: 1px solid var(--border-color);
    gap: 15px;
}

.action-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 26px;
    font-size: 14px;
    font-weight: 700;
    border-radius: var(--radius-sm);
    text-decoration: none;
    cursor: pointer;
    border: none;
    line-height: 1;
    box-sizing: border-box;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn .material-icons-outlined {
    font-size: 19px;
    display: inline-block;
    vertical-align: middle;
}

.btn-primary {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: #ffffff;
    box-shadow: 0 6px 18px var(--accent-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(99, 102, 241, 0.35);
}

.btn-submit {
    background: linear-gradient(135deg, #ec4899 0%, #8b5cf6 100%);
    color: #ffffff;
    box-shadow: 0 6px 18px rgba(236, 72, 153, 0.3);
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(236, 72, 153, 0.45);
}

.btn-secondary {
    background: #f1f5f9;
    color: var(--text-secondary);
}

.btn-secondary:hover {
    background: #e2e8f0;
    color: var(--primary-color);
}

.btn-outline {
    background: #ffffff;
    color: var(--primary-color);
    border: 1px solid #cbd5e1;
}

.btn-outline:hover {
    border-color: var(--accent-vibrant);
    color: var(--accent-vibrant);
}

/* ==========================================================================
   RESPONSIVE LAYOUT FOR SMARTPHONE & TABLET (<= 768px)
   ========================================================================== */
@media (max-width: 768px) {
    /* Container & Grid Adjustments */
    .container {
        padding: 24px 16px;
        border-radius: var(--radius-md);
    }

    .form-grid {
        grid-template-columns: 1fr !important;
        gap: 16px;
    }

    .form-group, 
    .full-width {
        grid-column: span 1 !important;
        width: 100%;
    }

    /* Stepper Adjustments */
    .stepper {
        gap: 6px;
        padding: 6px;
    }

    .step-item {
        height: 42px;
        min-width: 42px;
        padding: 0 8px;
    }

    .step-item.active .step-label {
        font-size: 12px;
    }

    /* Form Actions & Stacked Buttons */
    .form-actions {
        flex-direction: column-reverse;
        align-items: stretch;
        gap: 12px;
        width: 100%;
    }

    .action-right {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        gap: 12px !important;
    }

    .btn, 
    .form-actions > a {
        width: 100%;
        box-sizing: border-box;
    }
}

/* ==========================================================================
   DYNAMIC ITEM HEADER & REMOVE BUTTON FIX
   ========================================================================== */
.dynamic-item {
    position: relative;
    background: #ffffff;
    border: 1.5px solid var(--border-color);
    padding: 24px 20px 20px 20px;
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.dynamic-item:hover {
    border-color: var(--border-hover);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.04);
}

/* Tombol Hapus Modern Badge Style */
.btn-remove {
    position: absolute;
    top: 16px;
    right: 16px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 700;
    color: #ef4444;
    background: #fef2f2;
    border: 1px solid #fca5a5;
    border-radius: var(--radius-sm);
    cursor: pointer;
    line-height: 1;
    transition: all 0.2s ease;
    z-index: 2;
}

.btn-remove .material-icons-outlined {
    font-size: 16px;
    color: #ef4444;
}

.btn-remove:hover {
    background: #ef4444;
    color: #ffffff;
    border-color: #ef4444;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.25);
}

.btn-remove:hover .material-icons-outlined {
    color: #ffffff;
}

/* Penyesuaian Responsif Layar Smartphone */
@media (max-width: 768px) {
    .dynamic-item {
        padding: 48px 16px 16px 16px; /* Memberikan ruang atas agar tombol hapus tidak menutupi input */
    }

    .btn-remove {
        top: 12px;
        right: 12px;
    }
}