/* ============================================================
   GA Asset Inventory Form — Stylesheet
   Theme: Liquid Glass Dark
   ============================================================ */

/* --- Google Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ============================================================
   1. CSS VARIABLES
   ============================================================ */
:root {
    --bg-color:       #0f172a;
    --card-bg:        rgba(255, 255, 255, 0.05);
    --card-border:    rgba(255, 255, 255, 0.1);
    --text-primary:   #f8fafc;
    --text-secondary: #94a3b8;
    --accent-color:   #38bdf8;
    --input-bg:       rgba(0, 0, 0, 0.2);
    --error-color:    #ef4444;
    --success-color:  #22c55e;
}

/* ============================================================
   2. RESET
   ============================================================ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ============================================================
   3. BODY & BACKGROUND
   ============================================================ */
body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 32px 20px;
    background-image:
        radial-gradient(circle at 10% 20%, rgba(56, 189, 248, 0.12) 0%, transparent 45%),
        radial-gradient(circle at 90% 80%, rgba(139, 92, 246, 0.12) 0%, transparent 45%),
        radial-gradient(circle at 50% 50%, rgba(34, 197, 94, 0.04) 0%, transparent 60%);
}

/* ============================================================
   4. LAYOUT
   ============================================================ */
.container {
    width: 100%;
    max-width: 620px;
}

/* ============================================================
   5. CARD
   ============================================================ */
.card {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--card-border);
    border-radius: 32px;
    padding: 40px 44px;
    box-shadow:
        0 25px 50px -12px rgba(0, 0, 0, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    animation: fadeInUp 0.55s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(24px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ============================================================
   6. HEADER
   ============================================================ */
h1 {
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 6px;
    text-align: center;
    background: linear-gradient(135deg, #38bdf8 0%, #818cf8 50%, #a78bfa 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

p.subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 32px;
    font-size: 13px;
    letter-spacing: 0.02em;
}

/* ============================================================
   7. FORM LAYOUT
   ============================================================ */

/* Satu kolom standar */
.form-group {
    margin-bottom: 20px;
    position: relative;
}

/* Dua kolom sejajar — dipakai untuk UOM + QTY */
.form-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 14px;
}

.form-row .form-group {
    margin-bottom: 20px;
}

/* ============================================================
   8. LABEL
   ============================================================ */
label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 8px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.optional-tag {
    font-size: 11px;
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
    color: var(--text-secondary);
    opacity: 0.6;
    margin-left: auto;
}

/* ============================================================
   9. INPUTS — Base Styles
   ============================================================ */
input[type="text"],
input[type="date"],
input[type="number"],
input[type="file"],
select,
textarea {
    width: 100%;
    background: var(--input-bg);
    border: 1px solid var(--card-border);
    border-radius: 14px;
    padding: 13px 16px;
    color: var(--text-primary);
    font-size: 15px;
    font-family: inherit;
    transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

input[type="text"]::placeholder,
textarea::placeholder {
    color: rgba(148, 163, 184, 0.45);
}

/* Focus ring */
input[type="text"]:focus,
input[type="date"]:focus,
input[type="number"]:focus,
select:focus,
textarea:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.18);
    background: rgba(56, 189, 248, 0.04);
}

/* ============================================================
   10. SELECT DROPDOWN
   ============================================================ */
select {
    cursor: pointer;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 15px;
    padding-right: 40px;
}

select option {
    background-color: #1e293b;
    color: var(--text-primary);
    font-size: 14px;
}

select optgroup {
    background-color: #0f172a;
    color: var(--accent-color);
    font-weight: 700;
    font-style: normal;
    padding: 6px 0;
}

/* ============================================================
   11. DATE PICKER ICON
   ============================================================ */
input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(0.7) hue-rotate(200deg);
    cursor: pointer;
    opacity: 0.8;
}

/* ============================================================
   12. NUMBER INPUT (QTY)
   ============================================================ */

/* Sembunyikan spinner panah */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
input[type="number"] {
    -moz-appearance: textfield;
    text-align: center;
    font-weight: 700;
    font-size: 20px;
    letter-spacing: 1px;
    padding: 13px 8px;
}

/* ============================================================
   13. TEXTAREA
   ============================================================ */
textarea {
    resize: vertical;
    min-height: 90px;
    line-height: 1.6;
}

/* ============================================================
   14. FILE INPUT
   ============================================================ */
input[type="file"] {
    padding: 10px 12px;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 14px;
}

input[type="file"]::file-selector-button {
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.15), rgba(129, 140, 248, 0.15));
    border: 1px solid rgba(56, 189, 248, 0.25);
    border-radius: 8px;
    color: var(--accent-color);
    padding: 6px 14px;
    margin-right: 12px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    transition: all 0.2s ease;
}

input[type="file"]::file-selector-button:hover {
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.25), rgba(129, 140, 248, 0.25));
    border-color: rgba(56, 189, 248, 0.5);
}

/* Photo source buttons (Galeri / Kamera) */
.photo-source-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 4px;
}

.btn-photo-source {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: rgba(56, 189, 248, 0.08);
    border: 1px solid rgba(56, 189, 248, 0.25);
    color: var(--accent-color);
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.22s ease;
}

.btn-photo-source.btn-camera {
    background: rgba(129, 140, 248, 0.08);
    border-color: rgba(129, 140, 248, 0.25);
    color: #a78bfa;
}

.btn-photo-source:hover {
    transform: translateY(-1px);
    filter: brightness(1.2);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.btn-photo-source:active {
    transform: translateY(0);
}

/* File preview text */
.file-preview {
    margin-top: 8px;
    font-size: 12.5px;
    color: var(--text-secondary);
    min-height: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding-left: 4px;
}

/* ============================================================
   15. STATUS ASSET PILLS (Radio)
   ============================================================ */
.status-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 4px;
}

/* Sembunyikan native radio */
.status-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.status-option {
    cursor: pointer;
    user-select: none;
}

/* Pill dasar */
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: 100px;
    font-size: 14px;
    font-weight: 600;
    border: 1.5px solid transparent;
    transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.status-option:hover .status-pill {
    transform: translateY(-1px);
    filter: brightness(1.15);
}

/* Warna — Normal */
.status-pill.status-bagus {
    background: rgba(34, 197, 94, 0.08);
    border-color: rgba(34, 197, 94, 0.25);
    color: #4ade80;
}

.status-pill.status-rusak-sebagian {
    background: rgba(245, 158, 11, 0.08);
    border-color: rgba(245, 158, 11, 0.25);
    color: #fbbf24;
}

.status-pill.status-rusak {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.25);
    color: #f87171;
}

/* Tidak Ditemukan → Abu-abu/Slate */
.status-pill.status-tidak-ditemukan {
    background: rgba(148, 163, 184, 0.08);
    border-color: rgba(148, 163, 184, 0.25);
    color: #94a3b8;
}

/* Warna — Checked/Terpilih */
.status-option input[type="radio"]:checked + .status-pill.status-bagus {
    background: rgba(34, 197, 94, 0.2);
    border-color: #22c55e;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.15);
}

.status-option input[type="radio"]:checked + .status-pill.status-rusak-sebagian {
    background: rgba(245, 158, 11, 0.2);
    border-color: #f59e0b;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15);
}

.status-option input[type="radio"]:checked + .status-pill.status-rusak {
    background: rgba(239, 68, 68, 0.2);
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

.status-option input[type="radio"]:checked + .status-pill.status-tidak-ditemukan {
    background: rgba(148, 163, 184, 0.2);
    border-color: #94a3b8;
    box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.15);
}

/* ============================================================
   16. SUBMIT BUTTON
   ============================================================ */
button.btn-submit {
    width: 100%;
    background: linear-gradient(135deg, #38bdf8, #2563eb);
    color: white;
    border: none;
    padding: 16px;
    border-radius: 100px;
    font-size: 15px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-top: 12px;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.4);
    letter-spacing: 0.03em;
}

button.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(37, 99, 235, 0.5);
}

button.btn-submit:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

button.btn-submit:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ============================================================
   17. FEEDBACK MESSAGE
   ============================================================ */
#form-feedback {
    margin-top: 16px;
    padding: 14px 18px;
    border-radius: 14px;
    text-align: center;
    display: none;
    font-size: 14px;
    font-weight: 500;
    animation: feedbackPop 0.3s ease;
}

@keyframes feedbackPop {
    from { opacity: 0; transform: scale(0.97); }
    to   { opacity: 1; transform: scale(1); }
}

.feedback-success {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.25);
    color: #4ade80;
}

.feedback-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: #f87171;
}

/* ============================================================
   18. FOOTER
   ============================================================ */
.footer {
    text-align: center;
    margin-top: 20px;
    font-size: 11px;
    font-weight: 500;
    color: rgba(148, 163, 184, 0.4);
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

/* ============================================================
   19. CROP MODAL
   ============================================================ */
.crop-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    inset: 0;
    background-color: rgba(10, 16, 30, 0.92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.crop-modal-content {
    background: rgba(20, 30, 50, 0.96);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    width: 100%;
    max-width: 580px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    padding: 24px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7);
    animation: modalSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalSlideIn {
    from { opacity: 0; transform: translateY(20px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.crop-modal-content h2 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    text-align: center;
    color: var(--text-primary);
}

.crop-container {
    width: 100%;
    max-height: 52vh;
    overflow: hidden;
    margin-bottom: 16px;
    background: #000;
    border-radius: 12px;
    border: 1px solid var(--card-border);
}

.crop-container img {
    max-width: 100%;
    display: block;
}

.crop-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 16px;
}

.btn-action,
.btn-cancel {
    background: rgba(255, 255, 255, 0.07);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 10px 20px;
    border-radius: 100px;
    cursor: pointer;
    font-weight: 500;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.2s ease;
}

.btn-action:hover,
.btn-cancel:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.2);
}

.crop-footer {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.crop-footer button {
    flex: 1;
    margin-top: 0;
}

.crop-footer .btn-cancel {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.2);
    color: #f87171;
}

.crop-footer .btn-cancel:hover {
    background: rgba(239, 68, 68, 0.2);
}

/* ============================================================
   20. RESPONSIVE
   ============================================================ */
@media (max-width: 540px) {
    body {
        padding: 16px 12px;
    }
    .card {
        padding: 28px 20px;
        border-radius: 24px;
    }
    h1 {
        font-size: 22px;
    }
    .form-row {
        grid-template-columns: 1fr 80px;
        gap: 10px;
    }
    .status-pill {
        padding: 9px 14px;
        font-size: 13px;
    }
}

@media (max-width: 380px) {
    .form-row {
        grid-template-columns: 1fr;
    }
    .status-group {
        flex-direction: column;
    }
    .status-pill {
        width: 100%;
        justify-content: center;
    }
}