body {
    font-family: "Inter", system-ui, -apple-system, sans-serif;
    margin: 0;
    min-height: 100vh;
    color: #0f172a;
}

body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.card-header {
    /* width: min(600px, 90%); */
    display: flex;
    align-items: center;
    padding: 20px 0;
    margin-bottom: 0;
}

.card-header img {
    height: 58px;
    width: auto;
    display: block;
}

.card {
    position: relative;
    width: min(600px, 90%);
    background: #ffffff;
    border: 1px solid #eaeaea;
    border-radius: 14px;
    padding: 32px;
    margin: 12px auto;
    margin-left: auto;
    margin-right: auto;
    backdrop-filter: blur(12px);
    /* box-shadow: 0 10px 12px rgba(15, 23, 42, 0.65); */
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
}

.action-bar {
    position: relative;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    border-radius: 12px;
    margin-bottom: 24px;
    border: 1px solid #eaeaea;
}

.action-bar button,
.action-bar a {
    padding: 10px 20px;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    flex: 1;
    min-width: 120px;
    justify-content: center;
}

.action-bar button:hover,
.action-bar a:hover {
    transform: translateY(-1px);
}

.btn-primary {
    background: #2c3e7a;
    color: #ffffff;
}

.btn-secondary {
    background: #e62727;
    color: #ffffff;
}

.btn-success {
    background: #10b981;
    color: #ffffff;
}

h1 {
    margin-top: 0;
    font-size: 1.75rem;
    font-weight: 600;
    letter-spacing: -0.03em;
}

p {
    color: black;
    line-height: 1.6;
}

form {
    display: grid;
    gap: 16px;
    margin-top: 24px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

label {
    font-weight: 600;
    display: block;
    margin-bottom: 8px;
}

input[type="password"],
input[type="text"] {
    width: 100%;
    max-width: 100%;
    padding: 12px 16px;
    border-radius: 12px;
    border: 2px solid rgba(148, 163, 184, 0.3);
    color: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
    margin: 0;
}

input[type="password"]:focus,
input[type="text"]:focus {
    border-color: #2c3e7a;
    outline: none;
}

/* Custom File Input */
.file-input-wrapper {
    position: relative;
    width: 100%;
    box-sizing: border-box;
    max-width: 100%;
}

input[type="file"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    overflow: hidden;
}

.file-input-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    border: 2px dashed rgba(148, 163, 184, 0.4);
    border-radius: 12px;
    background: #f8f9fa;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
}

.file-input-label:hover {
    border-color: #2c3e7a;
    background: #f0f4ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(44, 62, 122, 0.15);
}

.file-input-label.dragover {
    border-color: #2c3e7a;
    background: #e8edff;
    border-style: solid;
}

.file-input-icon {
    font-size: 48px;
    margin-bottom: 12px;
    color: #2c3e7a;
}

.file-input-text {
    font-weight: 600;
    color: #2c3e7a;
    margin-bottom: 4px;
    font-size: 1rem;
    word-wrap: break-word;
    word-break: break-word;
    max-width: 100%;
    padding: 0 8px;
    box-sizing: border-box;
}

.file-input-hint {
    font-size: 0.85rem;
    color: #6b7280;
    word-wrap: break-word;
    word-break: break-word;
    max-width: 100%;
    padding: 0 8px;
    box-sizing: border-box;
}

.file-name-display {
    margin-top: 12px;
    padding: 10px 14px;
    background: #e8edff;
    border-radius: 8px;
    font-size: 0.9rem;
    color: #2c3e7a;
    display: none;
    align-items: center;
    gap: 8px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.file-name-display.show {
    display: flex;
}

.file-name-display .file-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.file-name-display .file-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    word-break: break-all;
}

button[type="submit"] {
    padding: 14px 20px;
    border-radius: 14px;
    border: none;
    font-weight: 600;
    font-size: 1rem;
    background: #2c3e7a;
    color: #ffffff;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

button[type="submit"]:hover {
    transform: translateY(-1px);
    background: #32478b;
}

.alert {
    padding: 14px 18px;
    border-radius: 12px;
    font-size: 0.95rem;
    margin-top: 18px;
}

.alert-success {
    background: rgba(34, 197, 94, 0.12);
    border: 1px solid rgba(74, 222, 128, 0.35);
}

.alert-error {
    background: rgba(248, 113, 113, 0.12);
    border: 1px solid rgba(248, 113, 113, 0.35);
}

.download-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.4);
    margin-top: 12px;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.download-link:hover {
    border-color: rgba(56, 189, 248, 0.6);
    /* background: rgba(30, 64, 175, 0.35); */
}

.helper {
    font-size: 0.9rem;
    color: black;
    margin-top: 4px;
}

.file-alert {
    margin-top: 12px;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    display: none;
    align-items: center;
    gap: 8px;
}

.file-alert.show {
    display: flex;
}

.file-alert.error {
    background: rgba(248, 113, 113, 0.12);
    border: 1px solid rgba(248, 113, 113, 0.35);
    color: #dc2626;
}

.file-alert .alert-icon {
    font-size: 18px;
}

button[type="submit"]:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.submit-loading {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.submit-loading.show {
    display: inline-flex;
}

.submit-text {
    display: inline;
}

.submit-text.hide {
    display: none;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.close {
    z-index: 99;
    position: absolute;
    top: 155px;
    right: 16px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #2c3e7a;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    text-decoration: none;
    margin-left: auto;
    padding: 0;
    margin-top: 8px;
}

.close:hover {
    transform: translateY(-1px);
    background: #32478b;
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        margin: 0 16px;
    }

    .card-header {
        padding: 16px 0;
    }

    .card-header img {
        height: 51px;
    }

    .card {
        width: 100%;
        max-width: 100%;
        padding: 24px 20px;
        margin: 8px auto;
        border-radius: 12px;
        box-sizing: border-box;
    }

    h1 {
        font-size: 1.5rem;
    }

    p {
        font-size: 0.95rem;
    }

    .action-bar {
        padding: 12px;
        gap: 8px;
        margin-bottom: 20px;
    }

    .action-bar button,
    .action-bar a {
        padding: 10px 16px;
        font-size: 0.85rem;
        min-width: 100px;
        flex: 1 1 auto;
    }

    .file-input-wrapper {
        width: 100%;
        max-width: 100%;
    }

    .file-input-label {
        padding: 30px 16px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .file-input-icon {
        font-size: 40px;
    }

    .file-input-text {
        font-size: 0.9rem;
        padding: 0 4px;
        word-wrap: break-word;
        word-break: break-word;
        max-width: 100%;
        overflow-wrap: break-word;
    }

    .file-name-display {
        padding: 8px 12px;
        gap: 6px;
    }

    .file-name-display .file-icon {
        font-size: 18px;
    }

    .file-name-display .file-name {
        font-size: 0.85rem;
        min-width: 0;
    }

    .file-alert {
        font-size: 0.85rem;
        padding: 10px 14px;
    }

    .file-input-hint {
        font-size: 0.8rem;
        padding: 0 4px;
        word-wrap: break-word;
        word-break: break-word;
    }

    input[type="password"],
    input[type="text"] {
        padding: 10px 14px;
        font-size: 0.95rem;
    }

    button[type="submit"] {
        padding: 12px 18px;
        font-size: 0.95rem;
    }

    .close {
        display: none;
    }
}

@media (max-width: 480px) {
    body {
        margin: 0 16px;
    }

    .card-header {
        padding: 12px 0;
    }

    .card-header img {
        height: 50px;
    }

    .card {
        padding: 20px 16px;
        margin: 8px auto;
        border-radius: 10px;
        box-sizing: border-box;
    }

    h1 {
        font-size: 1.3rem;
        margin-bottom: 12px;
    }

    p {
        font-size: 0.9rem;
        line-height: 1.5;
    }

    .action-bar {
        /* flex-direction: column; */
        padding: 12px;
        gap: 8px;
    }

    .action-bar button,
    .action-bar a {
        width: 100%;
        padding: 12px 16px;
        font-size: 0.9rem;
        min-width: unset;
    }

    form {
        gap: 14px;
        margin-top: 20px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    label {
        font-size: 0.9rem;
        margin-bottom: 6px;
    }

    .file-input-wrapper {
        width: 100%;
        max-width: 100%;
    }

    .file-input-label {
        padding: 24px 12px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .file-input-icon {
        font-size: 36px;
        margin-bottom: 10px;
    }

    .file-input-text {
        font-size: 0.85rem;
        margin-bottom: 6px;
        padding: 0 4px;
        word-wrap: break-word;
        word-break: break-word;
        line-height: 1.4;
        max-width: 100%;
        overflow-wrap: break-word;
    }

    .file-name-display {
        padding: 8px 10px;
        gap: 6px;
        margin-top: 10px;
    }

    .file-name-display .file-icon {
        font-size: 16px;
    }

    .file-name-display .file-name {
        font-size: 0.8rem;
        min-width: 0;
    }

    .file-alert {
        font-size: 0.8rem;
        padding: 10px 12px;
    }

    .file-alert .alert-icon {
        font-size: 16px;
    }

    .file-input-hint {
        font-size: 0.75rem;
        padding: 0 4px;
        word-wrap: break-word;
        word-break: break-word;
        line-height: 1.4;
    }

    input[type="password"],
    input[type="text"] {
        padding: 10px 12px;
        font-size: 0.9rem;
        border-radius: 10px;
    }

    button[type="submit"] {
        padding: 12px 16px;
        font-size: 0.9rem;
        border-radius: 10px;
    }

    .close {
        top: 120px;
        right: 10px;
        width: 26px;
        height: 26px;
        font-size: 0.85rem;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .card {
        width: min(600px, 85%);
        padding: 28px;
    }
}
