/* ============================================
   MegaPay Login Page - Modern CSS
   ============================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    --primary-color: #eb2525;
    --primary-light: #feecdb;
    --primary-dark: #c41e1e;
    --secondary-color: #b9106d;
    --accent-color: #f59e0b;
    --dark-color: #0f172a;
    --light-color: #ffffff;
    --gray-50: #f8fafc;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --gradient: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    --card-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    --card-shadow-lg: 0 20px 40px rgba(0,0,0,0.12);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    min-height: 100vh;
    color: var(--dark-color);
    background: linear-gradient(135deg, var(--gray-50) 0%, var(--primary-light) 50%, var(--gray-50) 100%);
    -webkit-font-smoothing: antialiased;
}

.main {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.container {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    width: 100%;
}

.form-container {
    width: 100%;
    max-width: 420px;
}

form {
    background: var(--light-color);
    padding: 36px 32px;
    border-radius: 18px;
    box-shadow: var(--card-shadow-lg);
    border: 1px solid rgba(0,0,0,0.06);
}

.title {
    text-align: center;
    margin-bottom: 28px;
}

.title .logo img {
    width: 70px;
    height: 70px;
    object-fit: contain;
    margin-bottom: 12px;
}

.title h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.input-control {
    position: relative;
    margin-bottom: 16px;
}

.input-control label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 8px;
}

.input-control label i {
    color: var(--gray-400);
    font-size: 0.85rem;
}

.input-control input {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid var(--gray-300);
    border-radius: 10px;
    font-size: 0.95rem;
    font-family: inherit;
    color: var(--dark-color);
    background: var(--light-color);
    outline: none;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.input-control input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(235, 37, 37, 0.1);
}

.input-control input::placeholder {
    color: var(--gray-400);
    font-size: 0.85rem;
}

.input-control span {
    display: block;
    font-size: 0.8rem;
    color: var(--danger-color);
    margin-top: 4px;
    min-height: 1em;
}

.input-control #show {
    position: absolute;
    right: 14px;
    bottom: 22px;
    cursor: pointer;
    color: var(--gray-400);
    transition: color 0.2s;
    font-size: 0.95rem;
}

.input-control #show:hover { color: var(--dark-color); }

.remember-forgot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    font-size: 0.85rem;
}

.check {
    display: flex;
    align-items: center;
    gap: 8px;
}

.check input[type="checkbox"] {
    accent-color: var(--primary-color);
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.check label {
    color: var(--gray-600);
    cursor: pointer;
    font-weight: 500;
}

.forgot a {
    color: var(--primary-color);
    font-weight: 600;
    transition: color 0.2s;
}

.forgot a:hover { color: var(--primary-dark); }

.button {
    margin-top: 8px;
}

.button button {
    width: 100%;
    padding: 13px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    color: var(--light-color);
    background: var(--gradient);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 6px 20px rgba(235, 37, 37, 0.35);
    font-family: inherit;
}

.button button:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 28px rgba(235, 37, 37, 0.45);
}

.button button:active {
    transform: translateY(0);
}

.signin-signup {
    text-align: center;
    margin-top: 20px;
    font-size: 0.9rem;
    color: var(--gray-500);
}

.signin-signup a {
    color: var(--primary-color);
    font-weight: 600;
    margin-left: 4px;
    transition: color 0.2s;
}

.signin-signup a:hover { color: var(--primary-dark); text-decoration: underline; }

.icons {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 20px;
}

.icons i {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    color: var(--gray-500);
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
}

.icons i:hover {
    color: var(--primary-color);
    border-color: var(--primary-color);
    transform: translateY(-1px);
}

.footer {
    text-align: center;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px dashed var(--gray-200);
    font-size: 0.8rem;
    color: var(--gray-500);
    line-height: 1.6;
}

.footer a { color: var(--accent-color); margin-left: 4px; }
.footer a:hover { text-decoration: underline; }

/* ========== POPUP ========== */
.popup {
    position: fixed;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 420px;
    padding: 14px 20px;
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
    border-radius: 12px;
    color: white;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s, visibility 0.4s, transform 0.4s;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
}

.popup.success { background: linear-gradient(135deg, #10b981, #059669); }
.popup.error { background: linear-gradient(135deg, #ef4444, #dc2626); }

.popup.show {
    opacity: 1;
    visibility: visible;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 480px) {
    .container { padding: 16px; }
    form { padding: 28px 20px; border-radius: 14px; }
    .title h2 { font-size: 1.3rem; }
    .title .logo img { width: 55px; height: 55px; }
}

/* Auto-show popup */
.popup:not(:empty) {
    animation: popupSlide 0.4s ease forwards;
}

@keyframes popupSlide {
    from { opacity: 0; transform: translateX(-50%) translateY(-20px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}
