:root {
    --primary: #005eb8;
    --secondary: #009688;
    --bg: #f4f7f6;
    --text: #333;
    --warning: #d32f2f;
    --phone-bg: #1a1a1a;
    --phone-screen: #fff;
}

* {
    box-sizing: border-box;
}

body {
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg);
    margin: 0;
    padding: 0;
    color: var(--text);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.local-disclaimer {
    background-color: var(--warning);
    color: white;
    text-align: center;
    padding: 0.625rem;
    font-weight: bold;
    font-size: 0.9rem;
    border-radius: 0.25rem;
    margin-bottom: 1.25rem;
}

.main-container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1.25rem;
}

.card {
    background: white;
    width: 100%;
    max-width: 28.125rem;
    padding: 2.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 0.25rem 0.9375rem rgba(0, 0, 0, 0.1);
    text-align: center;
    display: none;
}

.card.active {
    display: block;
    animation: fadeIn 0.5s;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(0.625rem);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

h1 {
    color: var(--primary);
    margin-bottom: 1.25rem;
    font-size: 1.8rem;
}
h2 {
    color: var(--secondary);
    font-size: 1.2rem;
    margin-bottom: 0.9375rem;
}
p {
    margin-bottom: 1.25rem;
    line-height: 1.5;
    color: #555;
}

.form-group {
    margin-bottom: 0.9375rem;
    text-align: left;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    font-size: 0.9rem;
}

input {
    width: 100%;
    padding: 0.625rem;
    border: 1px solid #ccc;
    border-radius: 0.25rem;
    font-size: 1rem;
    box-sizing: border-box;
}

button.btn-primary {
    background-color: var(--primary);
    color: white;
    border: none;
    padding: 0.75rem 1.25rem;
    border-radius: 0.25rem;
    cursor: pointer;
    width: 100%;
    font-size: 1rem;
    margin-top: 0.625rem;
    transition: background 0.3s;

}

button.btn-primary:hover {
    background-color: #00488f;
}

button.btn-secret-code {
    background-color: #2e7d32;
    color: white;
    border: none;
    padding: 0.75rem 1.25rem;
    border-radius: 0.25rem;
    cursor: pointer;
    width: 100%;
    font-size: 1rem;
    margin-top: 0.625rem;
    transition: background 0.3s;
}

.link-text {
    margin-top: 0.9375rem;
    font-size: 0.9rem;
    cursor: pointer;
    color: var(--primary);
    text-decoration: underline;
}

.error-msg {
    color: var(--warning);
    font-size: 0.9rem;
    margin-top: 0.625rem;
    display: none;
}

.phone-fab {
    position: fixed;
    bottom: 1.25rem;
    right: 1.25rem;
    width: 3.75rem;
    height: 3.75rem;
    background-color: var(--phone-bg);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 0.25rem 0.625rem rgba(0, 0, 0, 0.3);
    z-index: 2000;
    transition: transform 0.2s;
}

.phone-fab:hover {
    transform: scale(1.1);
}
.phone-fab svg {
    fill: white;
    width: 1.875rem;
    height: 1.875rem;
}

.phone-modal {
    position: fixed;
    bottom: 5.625rem;
    right: 1.25rem;
    width: 18.75rem;
    height: 34.375rem;
    background-color: var(--phone-bg);
    border-radius: 1.875rem;
    padding: 0.9375rem;
    box-sizing: border-box;
    display: none;
    z-index: 2000;
    box-shadow: 0 0.625rem 1.5625rem rgba(0, 0, 0, 0.4);
    border: 4px solid #333;
}

.phone-screen {
    background-color: #fff;
    width: 100%;
    height: 100%;
    border-radius: 1.25rem;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
}

.phone-header {
    background-color: #f1f1f1;
    padding: 0.625rem;
    font-size: 0.8rem;
    font-weight: bold;
    border-bottom: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.phone-header-left, .phone-header-right {
    display: flex;
    gap: 0.3125rem;
}

.app-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.9375rem;
    padding: 1.25rem;
}

.app-container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.app-icon {
    width: 100%;
    aspect-ratio: 1;
    background-color: #ddd;
    border-radius: 0.5rem;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    color: white;
}

.app-icon.auth-app {
    background-color: #2c3e50;
    color: white;
    font-weight: bold;
    font-size: 1.5rem;
}

.app-label {
    font-size: 10px;
    text-align: center;
    margin-top: 4px;
    color: #333;
    width: 100%;
}

.auth-screen {
    display: none;
    flex-direction: column;
    padding: 1.25rem;
    height: 100%;
    background-color: #fff;
}

.auth-screen h3 {
    margin: 0 0 1.25rem 0;
    color: #333;
}

.auth-code-box {
    background-color: #f0f4f8;
    padding: 0.9375rem;
    border-radius: 0.5rem;
    margin-bottom: 0.625rem;
}

.auth-provider {
    font-size: 0.8rem;
    color: #666;
}
.auth-code {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary);
    letter-spacing: 2px;
}
.auth-timer {
    font-size: 0.7rem;
    color: var(--warning);
    margin-top: 5px;
}

.back-btn {
    margin-top: auto;
    background: #eee;
    border: none;
    padding: 0.625rem;
    width: 100%;
    cursor: pointer;
    border-radius: 0.3125rem;
}

.scan-qr-placeholder {
    width: 9.375rem;
    height: 9.375rem;
    background: url("https://api.qrserver.com/v1/create-qr-code/?size=150x150&data=EasterEgg")
        no-repeat center center;
    background-size: contain;
    margin: 0 auto 1.25rem auto;
    border: 1px solid #ddd;
}

.mail-screen {
    display: none;
    flex-direction: column;
    height: 100%;
    background-color: #f7f7f7;
}

.mail-header {
    background-color: white;
    padding: 0.9375rem;
    border-bottom: 1px solid #ddd;
}

.mail-header h3 {
    margin: 0;
    font-size: 1.2rem;
}

.mail-list {
    flex: 1;
    overflow-y: auto;
}

.mail-item {
    background-color: white;
    padding: 0.75rem;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    cursor: pointer;
}

.mail-item:active {
    background-color: #f0f0f0;
}

.mail-item.unread {
    background-color: #fff;
}

.mail-item.unread .mail-sender,
.mail-item.unread .mail-subject {
    font-weight: bold;
}

.mail-avatar {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background-color: var(--primary);
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.9rem;
    margin-right: 0.75rem;
    flex-shrink: 0;
}

.mail-content {
    flex: 1;
    overflow: hidden;
}

.mail-sender {
    font-size: 0.9rem;
    color: #333;
}

.mail-subject {
    font-size: 0.85rem;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mail-preview {
    font-size: 0.8rem;
    color: #777;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mail-time {
    font-size: 0.75rem;
    color: #999;
    margin-left: 0.5rem;
    align-self: flex-start;
    margin-top: 2px;
}

.mail-detail-header {
    background-color: white;
    padding: 0.625rem;
    border-bottom: 1px solid #ddd;
    display: flex;
    align-items: center;
}

.back-icon {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    margin-right: 0.625rem;
    color: var(--primary);
}

.mail-detail-body {
    padding: 1.25rem;
    background: white;
    flex: 1;
    overflow-y: auto;
}

.md-subject {
    margin: 0 0 0.9375rem 0;
    font-size: 1.2rem;
}

.md-meta {
    display: flex;
    align-items: center;
    margin-bottom: 1.25rem;
    padding-bottom: 0.9375rem;
    border-bottom: 1px solid #eee;
}

.mail-avatar.small {
    width: 2rem;
    height: 2rem;
    font-size: 0.7rem;
}

.md-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.md-sender {
    font-weight: bold;
    font-size: 0.9rem;
}
.md-to {
    font-size: 0.8rem;
    color: #777;
}

.md-content {
    font-size: 0.95rem;
    line-height: 1.6;
}

.secret-code-box {
    background-color: #e8f5e9;
    border: 2px dashed #4caf50;
    padding: 15px;
    margin-block: 1.25rem;
    border-radius: 8px;
    color: #2e7d32;
    font-family: "Courier New", Courier, monospace;
    font-weight: bold;
    font-size: 1.1rem;
    position: relative;
}

.secret-label {
    display: block;
    font-size: 0.8rem;
    margin-bottom: 5px;
    text-transform: uppercase;
    color: #66bb6a;
}

.notification-dot {
    position: absolute;
    top: 0;
    right: 0;
    width: 1rem;
    height: 1rem;
    background-color: var(--warning);
    border-radius: 50%;
    border: 2px solid #fff;
    display: none;
    z-index: 2001;
}

.app-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.notification-badge {
    position: absolute;
    top: -.4rem;
    right: -.4rem;
    background-color: var(--warning);
    color: white;
    font-size: 0.7rem;
    font-weight: bold;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    display: none;
    border: 2px solid white;
}
