@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600&display=swap');

:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-main: #f8fafc;
    --text-dim: #94a3b8;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', sans-serif;
    background: var(--bg-gradient);
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-main);
    overflow: hidden;
}

/* Background Animation */
.bg-blobs {
    position: absolute;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.blob {
    position: absolute;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, rgba(0, 0, 0, 0) 70%);
    border-radius: 50%;
    animation: move 20s infinite alternate;
}

.blob-1 {
    top: -100px;
    left: -100px;
}

.blob-2 {
    bottom: -100px;
    right: -100px;
    animation-delay: -5s;
}

@keyframes move {
    from {
        transform: translate(0, 0);
    }

    to {
        transform: translate(100px, 100px);
    }
}

/* Login Card */
.login-container {
    width: 100%;
    max-width: 400px;
    padding: 2rem;
    perspective: 1000px;
}

.login-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 2.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header h1 {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    background: linear-gradient(to right, #fff, #94a3b8);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.login-header p {
    color: var(--text-dim);
    font-size: 0.95rem;
}

/* Form Styles */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-dim);
}

.input-wrapper {
    position: relative;
}

.input-wrapper input {
    width: 100%;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: #fff;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.input-wrapper input:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(0, 0, 0, 0.3);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.login-btn {
    width: 100%;
    padding: 14px;
    background: var(--primary);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1rem;
}

.login-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(99, 102, 241, 0.4);
}

.login-btn:active {
    transform: translateY(0);
}

/* Alert Message */
.alert {
    padding: 12px;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    text-align: center;
    animation: shake 0.5s ease-in-out;
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #f87171;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    75% {
        transform: translateX(5px);
    }
}

.footer-text {
    text-align: center;
    margin-top: 2rem;
    font-size: 0.85rem;
    color: var(--text-dim);
}

.footer-text a {
    color: var(--primary);
    text-decoration: none;
}

/* --- Responsive Media Queries --- */

/* Tablets and small desktops */
@media (max-width: 1024px) {

    .preview-container,
    .summary-container {
        max-width: 90%;
        padding: 2rem;
    }
}

/* Mobile Devices */
@media (max-width: 768px) {
    body {
        height: auto;
        min-height: 100vh;
        overflow-y: auto;
        padding: 1rem;
        display: block;
        /* Stack vertically on mobile */
    }

    .login-container,
    .dashboard-container,
    .report-card,
    .preview-container,
    .summary-container {
        margin: 1rem auto;
        padding: 1.5rem;
    }

    .grid-layout {
        grid-template-columns: 1fr;
        /* Stack all summary boxes */
    }

    .full-width {
        grid-column: span 1;
    }

    .header-section,
    .header-flex {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 1.5rem;
    }

    .btn-group,
    .action-btns {
        width: 100%;
        flex-direction: column;
        gap: 0.75rem;
    }

    .btn-group a,
    .action-btns a,
    .login-btn {
        width: 100%;
        text-align: center;
    }

    .amount-display {
        font-size: 1.5rem;
    }

    .doc-flex {
        flex-direction: column;
        gap: 1.5rem;
    }

    .doc-block {
        padding-left: 0 !important;
        border-left: none !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        padding-bottom: 1rem;
    }

    .doc-block:last-child {
        border-bottom: none;
        padding-bottom: 0;
    }

    .form-row {
        flex-direction: column;
        gap: 1rem;
    }

    .preview-container h1,
    .summary-container h1 {
        font-size: 1.5rem !important;
    }
}

/* Very Small Devices */
@media (max-width: 480px) {
    .login-card {
        padding: 1.5rem;
    }

    .login-header h1 {
        font-size: 1.5rem;
    }

    .hsn-item {
        font-size: 0.75rem;
    }
}