body {
    font-family: Arial, sans-serif;
    font-size: 16px;
    background-color: #f4f1ee;
    margin: 0;
    padding: 0;
    color: #222;
}

.hidden {
    display: none !important;
}

.container {
    max-width: 800px;
    margin: 24px auto;
    background: #fff;
    padding: 24px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.login-card {
    margin-top: 8vh;
    text-align: center;
    padding: 40px 28px;
}

.login-crest {
    width: 88px;
    height: auto;
    margin-bottom: 12px;
}

h1 {
    margin: 0 0 8px;
    color: rgb(180, 34, 30);
}

.subtitle,
.login-copy {
    color: #555;
    line-height: 1.5;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    background: rgb(180, 34, 30);
    color: #fff;
    padding: 14px 24px;
}

.topbar-title {
    font-weight: bold;
    font-size: 18px;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 16px;
    text-align: right;
}

.user-name {
    font-weight: bold;
}

.user-email {
    font-size: 13px;
    opacity: 0.9;
}

.logout {
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.7);
    padding: 6px 12px;
    border-radius: 4px;
    text-decoration: none;
    white-space: nowrap;
}

.logout:hover {
    background: rgba(255, 255, 255, 0.12);
}

p {
    margin: 0 0 8px;
}

input[type="text"],
select,
.readonly-field {
    width: 100%;
    box-sizing: border-box;
    font-family: Arial, sans-serif;
    font-size: 16px;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    margin-bottom: 20px;
}

.readonly-field {
    background: #f7f7f7;
    color: #333;
    min-height: 20px;
}

select {
    background: #fff;
}

button,
.ms-login {
    width: 100%;
    padding: 12px;
    background-color: rgba(180, 34, 30, 0.9);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-sizing: border-box;
}

button:hover,
.ms-login:hover {
    background-color: rgba(180, 34, 30, 1);
}

button:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

input:disabled,
select:disabled {
    background: #f7f7f7;
    color: #333;
    cursor: not-allowed;
}

.source-btn:disabled,
.source-btn:disabled:hover {
    cursor: not-allowed;
    background: #fff;
    color: #333;
    opacity: 0.7;
}

.source-btn.active:disabled,
.source-btn.active:disabled:hover {
    background: rgba(180, 34, 30, 0.9);
    color: #fff;
    opacity: 1;
}

.dropzone.locked {
    pointer-events: none;
    cursor: not-allowed;
    background: #f7f7f7;
}

#restartBtn {
    margin-top: 20px;
}

.ms-login {
    background: #2f2f2f;
    margin-top: 8px;
}

.ms-login:hover {
    background: #1b1b1b;
}

.source-toggle {
    display: flex;
    margin-bottom: 16px;
    border: 1px solid #ccc;
    border-radius: 4px;
    overflow: hidden;
}

.source-btn {
    width: 50%;
    border-radius: 0;
    background: #fff;
    color: #333;
    border-right: 1px solid #ccc;
}

.source-btn:last-child {
    border-right: none;
}

.source-btn:hover {
    background: #f3eaea;
}

.source-btn.active {
    background: rgba(180, 34, 30, 0.9);
    color: #fff;
}

.dropzone {
    display: block;
    border: 2px dashed #ccc;
    border-radius: 6px;
    padding: 24px 12px;
    text-align: center;
    color: #555;
    margin-bottom: 20px;
    cursor: pointer;
    background: #fafafa;
}

.dropzone.dragover {
    border-color: rgb(180, 34, 30);
    background: #f8ecec;
}

.dropzone input[type="file"] {
    display: none;
}

.hint {
    font-size: 14px;
    margin: -12px 0 20px;
    color: #666;
}

.warning {
    color: #9a2a26;
}

.error-banner {
    background: #fdecea;
    color: #9a2a26;
    border: 1px solid #f5c2c0;
    border-radius: 4px;
    padding: 10px 12px;
    margin: 16px 0;
    text-align: left;
}

#qrCodeDisplay {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

#linkDisplay {
    text-align: center;
    margin-top: 8px;
}

#linkDisplay a {
    color: rgb(180, 34, 30);
}

@media (max-width: 640px) {
    .topbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .topbar-user {
        width: 100%;
        justify-content: space-between;
        text-align: left;
    }

    .container {
        margin: 12px;
        padding: 16px;
    }
}
