/* index.css - Custom CSS Design System for Halaman Keabsahan (Light Green Theme) */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    --bg-color: #f0fbf6; /* Light mint/green-ish slate background */
    --card-bg: rgba(255, 255, 255, 0.8); /* White transparent card */
    --card-border: rgba(16, 185, 129, 0.08); /* Subtle green border */
    --text-primary: #064e3b; /* Dark emerald for main text */
    --text-secondary: #374151; /* Dark gray for descriptions */
    
    --primary-color: #10b981; /* Emerald green */
    --primary-glow: rgba(16, 185, 129, 0.15);
    --primary-gradient: linear-gradient(135deg, #10b981 0%, #059669 100%);
    
    --success-color: #059669; /* Success green */
    --success-bg: rgba(5, 150, 105, 0.08);
    --success-border: rgba(5, 150, 105, 0.15);
    --success-glow: rgba(5, 150, 105, 0.2);
    
    --error-color: #dc2626; /* Coral red */
    --error-bg: rgba(220, 38, 38, 0.08);
    --error-border: rgba(220, 38, 38, 0.15);
    --error-glow: rgba(220, 38, 38, 0.2);
    
    --font-family: 'Outfit', sans-serif;
}

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

body {
    background-color: var(--bg-color);
    font-family: var(--font-family);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-x: hidden;
    position: relative;
}

/* Ambient Glowing Background Elements */
body::before, body::after {
    content: '';
    position: absolute;
    width: 350px;
    height: 350px;
    border-radius: 50%;
    filter: blur(140px);
    z-index: -1;
    opacity: 0.35;
    animation: floatGlow 12s infinite alternate ease-in-out;
}

body::before {
    background: #a7f3d0; /* Soft emerald green */
    top: 10%;
    left: 15%;
}

body::after {
    background: #c7d2fe; /* Soft lavender/indigo */
    bottom: 10%;
    right: 15%;
    animation-delay: -6s;
}

@keyframes floatGlow {
    0% {
        transform: translate(0, 0) scale(1);
    }
    100% {
        transform: translate(50px, 50px) scale(1.15);
    }
}

/* Container & Card Styles */
.container {
    width: 100%;
    max-width: 500px;
    padding: 20px;
    z-index: 10;
}

.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 40px 30px;
    box-shadow: 0 15px 35px rgba(4, 120, 87, 0.05), 0 5px 15px rgba(0, 0, 0, 0.02);
    text-align: center;
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    box-shadow: 0 20px 45px rgba(4, 120, 87, 0.1), 0 0 25px rgba(16, 185, 129, 0.04);
}

.logo-container {
    margin-bottom: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100px;
    height: 100px;
    background: #ffffff;
    border: 1px solid rgba(16, 185, 129, 0.12);
    border-radius: 50%;
    box-shadow: 0 8px 20px rgba(4, 120, 87, 0.05);
    padding: 8px;
    overflow: hidden;
}

.logo-container img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

h1 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 6px;
    color: #064e3b;
    letter-spacing: -0.02em;
}

p.subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 30px;
}

/* Form Styles */
.form-group {
    position: relative;
    margin-bottom: 24px;
    text-align: left;
}

.form-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: #047857;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.input-container {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #059669;
    display: flex;
    align-items: center;
    pointer-events: none;
    transition: color 0.3s;
}

.input-icon svg {
    width: 20px;
    height: 20px;
}

.form-input {
    width: 100%;
    padding: 16px 16px 16px 48px;
    background: #ffffff;
    border: 1px solid #a7f3d0;
    border-radius: 14px;
    color: #064e3b;
    font-family: var(--font-family);
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.form-input::placeholder {
    color: #a7f3d0;
}

.form-input:focus {
    outline: none;
    border-color: #10b981;
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.15);
}

.form-input:focus + .input-icon {
    color: #10b981;
}

/* Button CSS */
.btn-submit {
    width: 100%;
    padding: 16px;
    background: var(--primary-gradient);
    border: none;
    border-radius: 14px;
    color: #ffffff;
    font-family: var(--font-family);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 14px var(--primary-glow);
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.25);
    filter: brightness(1.05);
}

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

.btn-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Spinner Loader */
.spinner {
    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;
    display: none;
}

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

/* Modal Alert styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(6, 78, 59, 0.2);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: #ffffff;
    border: 1px solid rgba(16, 185, 129, 0.1);
    border-radius: 24px;
    padding: 35px;
    width: 90%;
    max-width: 450px;
    box-shadow: 0 25px 50px rgba(6, 78, 59, 0.1);
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: #059669;
    cursor: pointer;
    transition: color 0.2s;
}

.close-btn:hover {
    color: #064e3b;
}

.close-btn svg {
    width: 24px;
    height: 24px;
}

/* Success / Error Layout in Modal */
.result-header {
    margin-bottom: 24px;
}

.result-icon-container {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px auto;
}

.result-icon-container.success {
    background: var(--success-bg);
    border: 1px solid var(--success-border);
    box-shadow: 0 0 20px var(--success-glow);
}

.result-icon-container.error {
    background: var(--error-bg);
    border: 1px solid var(--error-border);
    box-shadow: 0 0 20px var(--error-glow);
}

.result-icon-container svg {
    width: 44px;
    height: 44px;
}

.result-icon-container.success svg {
    fill: var(--success-color);
}

.result-icon-container.error svg {
    fill: var(--error-color);
}

.result-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.result-title.success {
    color: var(--success-color);
}

.result-title.error {
    color: var(--error-color);
}

.result-message {
    font-size: 0.95rem;
    color: #374151;
}

/* Detail Fields with Scrollability */
.detail-container {
    background: #f0fdf4; /* Light emerald green details box */
    border: 1px solid rgba(16, 185, 129, 0.15);
    border-radius: 16px;
    padding: 20px;
    text-align: left;
    margin-top: 24px;
    max-height: 280px; /* Limit height to show scrollbar when fields overflow */
    overflow-y: auto;
}

/* Custom Scrollbar for detail container */
.detail-container::-webkit-scrollbar {
    width: 6px;
}

.detail-container::-webkit-scrollbar-track {
    background: transparent;
}

.detail-container::-webkit-scrollbar-thumb {
    background: #a7f3d0; /* Soft green thumb */
    border-radius: 10px;
}

.detail-container::-webkit-scrollbar-thumb:hover {
    background: #6ee7b7;
}

.detail-item {
    margin-bottom: 16px;
    border-bottom: 1px dashed rgba(16, 185, 129, 0.15);
    padding-bottom: 12px;
}

.detail-item:last-child {
    margin-bottom: 0;
    border-bottom: none;
    padding-bottom: 0;
}

.detail-label {
    font-size: 0.75rem;
    color: #047857; /* Medium green label */
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
    font-weight: 600;
}

.detail-value {
    font-size: 1rem;
    color: #064e3b; /* Dark green value text */
    font-weight: 600;
}

.btn-modal-close {
    width: 100%;
    margin-top: 24px;
    padding: 14px;
    background: #f0fdf4;
    border: 1px solid rgba(16, 185, 129, 0.15);
    border-radius: 12px;
    color: #064e3b;
    font-family: var(--font-family);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-modal-close:hover {
    background: #d1fae5;
}

/* Responsive adjust */
@media(max-width: 480px) {
    .card {
        padding: 30px 20px;
    }
    h1 {
        font-size: 1.5rem;
    }
    .modal-content {
        padding: 25px 20px;
    }
}
