:root {
            --grad-1: #ff6ec4;
            --grad-2: #8e44ad;
            --btn-login: #f15a29;
            --btn-login-hover: #d14e21;
        }

        body {
            height: 100vh;
            display: flex;
            justify-content: center;
            align-items: center;
            margin: 0;
            font-family: "Segoe UI", sans-serif;
            background: linear-gradient(135deg, var(--grad-1), var(--grad-2));
        }

        .login-card {
            width: 100%;
            max-width: 360px;
            background: #fff;
            border-radius: 20px;
            padding: 28px;
            box-shadow: 0 0 20px rgb(0 0 0 / .1);
            text-align: center;
            position: relative;
        }

        .logo-unsri {
            width: 120px;
            margin-bottom: 16px
        }

        .judul-aplikasi {
            font-size: 1.25rem;
            font-weight: 700;
            line-height: 1.35;
            margin-bottom: 24px
        }

        .btn-login,
        .btn-register {
            width: 48%;
            border-radius: 30px;
            font-weight: 600;
            border: none;
        }

        .btn-login {
            background: var(--btn-login);
            color: #fff
        }

        .btn-login:hover {
            background: var(--btn-login-hover);
            color: #fff;
        }

        .btn-register {
            background: #ccc;
            color: #333
        }

        .btn-register:hover {
            background: #bbb;
            color: #333;
        }

        .btn-group-custom {
            display: flex;
            gap: 10px;
            margin-top: 20px;
            justify-content: space-between
        }

        .form-hidden {
            max-height: 0;
            opacity: 0;
            overflow: hidden;
            transition: all 0.4s ease;
        }

        .form-visible {
        max-height: none; 
        opacity: 1;
        transition: all 0.4s ease;
        }

        /* eye icon */
        .pw-toggle {
            cursor: pointer
        }

        /* Loader */
        #loader {
            display: none;
            position: fixed;
            inset: 0;
            background: rgba(255, 255, 255, .8);
            z-index: 9999;
            flex-direction: column;
            align-items: center;
            justify-content: center
        }

        .spinner {
            width: 3rem;
            height: 3rem;
            border: 4px solid #e0e0e0;
            border-top: 4px solid #3498db;
            border-radius: 50%;
            animation: spin 1s linear infinite;
            margin-bottom: 15px
        }

        #fakultas-group {
            margin-top: 10px;
        }

        @keyframes spin {
            to {
                transform: rotate(360deg)
            }
        }

        /* Responsive tweak */
        @media(min-width:320px)and (max-width:768px) {
            .login-card {
        width: 90%;         /* tidak full, sisakan ruang di sisi */
        max-width: 300px;   /* batas lebar maksimal */
        padding: 12px;      /* padding dikurangi */
    }

    .form-visible {
        max-height: none; /* biar menyesuaikan konten */
    }

    .input-group .form-control,
    .input-group .form-select {
        padding: 6px 8px;
        font-size: 0.85rem;
    }

    .logo-unsri {
        width: 80px; /* logo lebih kecil */
        margin-bottom: 8px;
    }

    .judul-aplikasi {
        font-size: 0.95rem;
        margin-bottom: 12px;
        line-height: 1.3;
    }

    .btn-group-custom {
        gap: 6px;
        flex-direction: column;
    }

    .btn-group-custom .btn {
        width: 100%;
        font-size: 0.85rem;
        padding: 6px;
    }
    }
    /* Modal Overlay */
    .modal-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        backdrop-filter: blur(4px);
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 1050;
        padding: 20px;
    }

    /* Modal Container */
    .edit-profile-modal {
        background: #fff;
        border-radius: 16px;
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
        width: 100%;
        max-width: 480px;
        max-height: 90vh;
        overflow: hidden;
        position: relative;
        animation: modalFadeIn 0.3s ease-out;
    }

    @keyframes modalFadeIn {
        from {
            opacity: 0;
            transform: scale(0.9) translateY(-20px);
        }
        to {
            opacity: 1;
            transform: scale(1) translateY(0);
        }
    }

    /* Modal Header */
    .modal-header {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        color: white;
        padding: 20px 24px;
        position: relative;
        border-radius: 16px 16px 0 0;
    }

    .modal-title {
        font-size: 20px;
        font-weight: 600;
        margin: 0;
        text-align: center;
    }

    .modal-close {
        position: absolute;
        top: 50%;
        right: 20px;
        transform: translateY(-50%);
        background: none;
        border: none;
        color: white;
        font-size: 24px;
        cursor: pointer;
        padding: 4px;
        border-radius: 50%;
        transition: background-color 0.2s ease;
        width: 32px;
        height: 32px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .modal-close:hover {
        background-color: rgba(255, 255, 255, 0.2);
    }

    /* Modal Body */
    .modal-body {
        padding: 24px;
        max-height: calc(90vh - 140px);
        overflow-y: auto;
    }

    /* Custom Scrollbar */
    .modal-body::-webkit-scrollbar {
        width: 6px;
    }

    .modal-body::-webkit-scrollbar-track {
        background: #f1f1f1;
        border-radius: 3px;
    }

    .modal-body::-webkit-scrollbar-thumb {
        background: #c1c1c1;
        border-radius: 3px;
    }

    .modal-body::-webkit-scrollbar-thumb:hover {
        background: #a8a8a8;
    }

    /* Form Groups */
    .form-group {
        margin-bottom: 20px;
    }

    .form-group:last-of-type {
        margin-bottom: 24px;
    }

    /* Labels */
    .form-label {
        display: block;
        font-size: 14px;
        font-weight: 500;
        color: #374151;
        margin-bottom: 6px;
        position: relative;
    }

    .form-label.required::after {
        content: '*';
        color: #ef4444;
        margin-left: 4px;
    }

    /* Input Styles */
    .form-input, .form-select {
        width: 100%;
        padding: 12px 16px;
        border: 2px solid #e5e7eb;
        border-radius: 8px;
        font-size: 14px;
        color: #374151;
        background-color: #fff;
        transition: all 0.2s ease;
        box-sizing: border-box;
    }

    .form-input:focus, .form-select:focus {
        outline: none;
        border-color: #667eea;
        box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    }

    .form-input:hover, .form-select:hover {
        border-color: #d1d5db;
    }

    .form-input::placeholder {
        color: #9ca3af;
    }

    /* Select Specific Styles */
    .form-select {
        cursor: pointer;
        background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
        background-position: right 12px center;
        background-repeat: no-repeat;
        background-size: 16px;
        padding-right: 40px;
        appearance: none;
    }

    .form-select:focus {
        background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%23667eea' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    }

    /* Date Input Group */
    .date-input-group {
        display: flex;
        gap: 8px;
    }

    .date-input-group .form-select {
        flex: 1;
    }

    /* Textarea */
    .form-textarea {
        width: 100%;
        padding: 12px 16px;
        border: 2px solid #e5e7eb;
        border-radius: 8px;
        font-size: 14px;
        color: #374151;
        background-color: #fff;
        transition: all 0.2s ease;
        resize: vertical;
        min-height: 80px;
        font-family: inherit;
        box-sizing: border-box;
    }

    .form-textarea:focus {
        outline: none;
        border-color: #667eea;
        box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    }

    .form-textarea::placeholder {
        color: #9ca3af;
    }

    /* Modal Footer */
    .modal-footer {
        padding: 20px 24px;
        background-color: #f9fafb;
        border-top: 1px solid #e5e7eb;
        display: flex;
        justify-content: flex-end;
        gap: 12px;
        border-radius: 0 0 16px 16px;
    }

    /* Buttons */
    .btn-modal {
        padding: 12px 24px;
        border-radius: 8px;
        font-size: 14px;
        font-weight: 500;
        cursor: pointer;
        transition: all 0.2s ease;
        border: none;
        min-width: 80px;
    }

    .btn-cancel {
        background-color: #f3f4f6;
        color: #374151;
        border: 1px solid #d1d5db;
    }

    .btn-cancel:hover {
        background-color: #e5e7eb;
        border-color: #9ca3af;
    }

    .btn-save {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        color: white;
    }

    .btn-save:hover {
        background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    }

    .btn-save:active {
        transform: translateY(0);
    }

    /* Error States */
    .form-input.error, .form-select.error, .form-textarea.error {
        border-color: #ef4444;
        box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
    }

    .error-message {
        color: #ef4444;
        font-size: 12px;
        margin-top: 4px;
        display: block;
    }

    /* Success State */
    .form-input.success, .form-select.success {
        border-color: #10b981;
        box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
    }

    /* ========== RESPONSIVE DESIGN ========== */

    /* Tablet */
    @media (max-width: 768px) {
        .modal-overlay {
            padding: 16px;
        }
        
        .edit-profile-modal {
            max-width: 100%;
            max-height: 95vh;
            border-radius: 12px;
        }
        
        .modal-header {
            padding: 18px 20px;
            border-radius: 12px 12px 0 0;
        }
        
        .modal-title {
            font-size: 18px;
        }
        
        .modal-body {
            padding: 20px;
            max-height: calc(95vh - 130px);
        }
        
        .modal-footer {
            padding: 16px 20px;
            border-radius: 0 0 12px 12px;
        }
        
        .date-input-group {
            flex-direction: column;
            gap: 12px;
        }
    }

    /* Mobile */
    @media (max-width: 480px) {
        .modal-overlay {
            padding: 12px;
            align-items: flex-start;
            padding-top: 20px;
        }
        
        .edit-profile-modal {
            border-radius: 8px;
            max-height: calc(100vh - 40px);
        }
        
        .modal-header {
            padding: 16px 18px;
            border-radius: 8px 8px 0 0;
        }
        
        .modal-title {
            font-size: 17px;
        }
        
        .modal-close {
            right: 16px;
            font-size: 20px;
            width: 28px;
            height: 28px;
        }
        
        .modal-body {
            padding: 18px;
            max-height: calc(100vh - 140px);
        }
        
        .form-group {
            margin-bottom: 18px;
        }
        
        .form-input, .form-select, .form-textarea {
            padding: 14px 16px;
            font-size: 16px; /* Prevents zoom on iOS */
        }
        
        .modal-footer {
            padding: 16px 18px;
            border-radius: 0 0 8px 8px;
            flex-direction: column-reverse;
        }
        
        .btn-modal {
            width: 100%;
            padding: 14px 24px;
            font-size: 16px;
        }
    }

    /* Extra Small Mobile */
    @media (max-width: 360px) {
        .modal-overlay {
            padding: 8px;
        }
        
        .modal-body {
            padding: 16px;
        }
        
        .modal-footer {
            padding: 14px 16px;
        }
    }

    /* Dark mode support (optional) */
    @media (prefers-color-scheme: dark) {
        .edit-profile-modal {
            background: #1f2937;
            color: #f9fafb;
        }
        
        .form-input, .form-select, .form-textarea {
            background-color: #374151;
            border-color: #4b5563;
            color: #f9fafb;
        }
        
        .form-input::placeholder, .form-textarea::placeholder {
            color: #9ca3af;
        }
        
        .form-label {
            color: #d1d5db;
        }
        
        .modal-footer {
            background-color: #111827;
            border-color: #374151;
        }
        
        .btn-cancel {
            background-color: #374151;
            color: #d1d5db;
            border-color: #4b5563;
        }
        
        .btn-cancel:hover {
            background-color: #4b5563;
        }
    }

    /* Utility classes */
    .hidden {
        display: none !important;
    }

    .fade-in {
        animation: fadeIn 0.3s ease-in;
    }

    @keyframes fadeIn {
        from { opacity: 0; }
        to { opacity: 1; }
    }