/* Login Page Styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    overflow: hidden;
}

.hidden-dev-link {
    position: fixed;
    top: 6px;
    left: 8px;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: transparent;
    background: transparent;
    font-size: 10px;
    line-height: 1;
    z-index: 1300;
}

.hidden-dev-link:hover {
    color: transparent;
    background: transparent;
}

.hidden-dev-link:focus,
.hidden-dev-link:active {
    outline: none;
    color: transparent;
    background: transparent;
}

.login-wrapper {
    height: calc(100vh - 24px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 0;
}

.page-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
    padding: 1px 0;
    font-size: 10px;
    box-shadow: 0 -2px 5px rgba(0,0,0,0.1);
    z-index: 1002;
}


.login-container {
    width: 100%;
    max-width: 420px;
    padding: 8px 14px;
}

.login-card {
    background: white;
    border-radius: 15px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    padding: 14px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea, #764ba2);
}

.login-header {
    margin-bottom: 10px;
}

.login-header h2 {
    color: #6c757d;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 6px;
}

.login-logo {
    width: 60px;
    height: auto;
    margin-bottom: 8px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.login-header h1 {
    color: #333;
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 6px;
}

.login-header p {
    color: #6c757d;
    font-size: 14px;
    margin: 0;
}

.login-message {
    margin-bottom: 10px;
    padding: 8px;
    border-radius: 5px;
    font-weight: 500;
}

.login-form {
    margin-bottom: 10px;
}

.form-group {
    margin-bottom: 10px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    color: #495057;
    font-weight: 600;
    font-size: 14px;
}

.form-group input {
    width: 100%;
    padding: 9px 12px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    font-size: 14px;
    box-sizing: border-box;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group input::placeholder {
    color: #adb5bd;
}

.remember-me-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 2px 0 12px;
    color: #495057;
    font-size: 14px;
    cursor: pointer;
    user-select: none;
}

.remember-me-row input {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: #667eea;
    cursor: pointer;
}

.password-input-wrapper {
    position: relative;
}

.password-input-wrapper input {
    padding-right: 45px;
}

.password-toggle-btn {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    border: none;
    background: transparent;
    color: #6c757d;
    cursor: pointer;
    font-size: 16px;
    padding: 4px;
}

.password-toggle-btn:hover {
    color: #495057;
}

.cartoon-eye {
    font-size: 24px;
    line-height: 1;
    display: inline-block;
    transition: transform 0.2s ease;
    user-select: none;
}

.password-toggle-btn:hover .cartoon-eye {
    transform: scale(1.1);
}

.login-btn {
    width: 100%;
    padding: 10px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.login-btn:disabled {
    cursor: wait;
    opacity: 0.92;
    transform: none;
    box-shadow: none;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.login-btn:disabled:hover {
    transform: none;
    box-shadow: none;
}

.login-btn:active {
    transform: translateY(0);
}

.login-btn-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #ffffff;
    border-radius: 50%;
    display: none;
    flex: 0 0 auto;
}

.login-btn[data-loading="true"] .login-btn-spinner {
    display: inline-block;
    animation: login-btn-spin 0.8s linear infinite;
}

.login-btn[data-loading="true"] .login-btn-icon {
    display: none;
}

@keyframes login-btn-spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.login-footer {
    border-top: 1px solid #e9ecef;
    padding-top: 10px;
    margin-top: 10px;
}

.login-footer p {
    margin: 6px 0;
    font-size: 13px;
    color: #6c757d;
}

.login-footer a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.login-footer a:hover {
    color: #764ba2;
    text-decoration: underline;
}

.support-notice-btn {
    border: none;
    background: transparent;
    color: #667eea;
    padding: 0;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    margin-left: 6px;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.support-notice-btn:hover {
    color: #4c5fd7;
}

body.restore-in-progress .login-wrapper,
body.restore-in-progress .page-footer,
body.restore-in-progress .hidden-dev-link {
    filter: blur(4px);
    pointer-events: none;
    user-select: none;
}

.cloud-restore-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(8, 20, 40, 0.45);
}

.cloud-restore-card {
    width: min(92vw, 420px);
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.2);
    padding: 18px 18px 14px;
    text-align: center;
}

.cloud-restore-card h3 {
    margin: 0 0 8px;
    color: #2f3b52;
    font-size: 20px;
}

.cloud-restore-card p {
    margin: 0 0 12px;
    color: #53627a;
    font-size: 14px;
}

.cloud-restore-progress-track {
    width: 100%;
    height: 10px;
    border-radius: 999px;
    background: #e9edf7;
    overflow: hidden;
}

.cloud-restore-progress-bar {
    height: 100%;
    width: 0;
    border-radius: 999px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transition: width 0.25s ease;
}

#cloudRestoreProgressText {
    display: inline-block;
    margin-top: 8px;
    color: #4c5fd7;
    font-weight: 700;
}

.whatsapp-action-link {
    display: inline-block;
    text-decoration: none;
    background: #25D366;
    color: #fff;
    font-weight: 600;
    padding: 8px 12px;
    border-radius: 8px;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.whatsapp-action-link:hover {
    background: #1ebc59;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(37, 211, 102, 0.35);
}

.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1200;
    padding: 12px;
}

.modal-content {
    background: #fff;
    width: min(94vw, 460px);
    max-height: 85vh;
    overflow-y: auto;
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-bottom: 1px solid #e9ecef;
}

.modal-header h2 {
    font-size: 17px;
    margin: 0;
    color: #343a40;
}

.close-btn {
    font-size: 22px;
    cursor: pointer;
    color: #6c757d;
}

.modal-body {
    padding: 12px 14px 14px;
    font-size: 13px;
    color: #495057;
}

.modal-body ul {
    margin: 8px 0 0 18px;
}

.modal-body li {
    margin-bottom: 6px;
}

.modal-content.support-notice-content {
    width: min(94vw, 520px);
}

#helpModal .modal-content {
    width: min(94vw, 460px);
    border: 1px solid rgba(102, 126, 234, 0.16);
}

#helpModal .modal-header {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.1) 100%);
}

#helpModal .close-btn:hover {
    color: #dc3545;
}

#recoveryForm {
    display: grid;
    gap: 12px;
    margin-top: 8px;
}

#recoveryForm input {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid #d9dfec;
    border-radius: 10px;
    font-size: 14px;
    color: #2f3b52;
    background: #f7f9fd;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

#recoveryForm input:focus {
    outline: none;
    border-color: #667eea;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.14);
}

#recoveryForm button {
    width: 100%;
    justify-content: center;
    margin-top: 4px;
}

.recovery-result {
    margin-top: 16px;
    font-weight: 500;
    padding: 12px 14px;
    border-radius: 10px;
    background: #f7f9fd;
    color: #2f3b52;
    min-height: 20px;
    border: 1px solid #e1e7f3;
    line-height: 1.45;
}

@media (max-width: 520px) {
    .modal {
        padding: 10px;
    }

    .modal-content {
        width: 100%;
        max-height: 88vh;
    }

    .modal-header,
    .modal-body {
        padding-left: 12px;
        padding-right: 12px;
    }
}
