/*
Theme Name: Zimbra Web Client Sign In
Theme URI: https://example.com
Author: Developer
Author URI: https://example.com
Description: A custom WordPress theme for Zimbra web client sign-in page with server-side form processing and simplified customization options.
Version: 1.3
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Tags: custom, zimbra, login
Text Domain: zimbra-signin
*/
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    background: url('<?php echo esc_url(get_option('zimbra_bg_image', get_template_directory_uri() . '/images/bg.jpg')); ?>') no-repeat center center fixed;
    background-size: cover;
    background-color: <?php echo esc_attr(get_option('zimbra_bg_color', 'transparent')); ?>;
    min-height: 100vh;
    margin: 0;
    user-select: none;
    position: relative;
}

.zimbra-root {
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 20px;
    user-select: none;
}

.step {
    display: none;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.step.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.zimbra-card {
    width: min(400px, 90vw);
    border: 0px solid #d6d6d6;
    background: #fff;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
    border-radius: 2px;
    margin-top: 70px;
    user-select: none;
}

.header {
    padding: 22px 35px 14px;
    background: #fff;
    display: flex;
    flex-direction: column;
    align-items: left;
    pointer-events: auto;
    user-select: none;
}

.header img {
    height: 36px;
    max-width: 100px;
    object-fit: contain;
    margin-bottom: 10px;
    pointer-events: none;
    user-select: none;
    outline: none;
}

.header-title {
    font-size: clamp(14px, 5vw, 20px);
    color: #333;
    font-weight: 600;
    user-select: none;
}

#card-second-step .header-title {
    color: red;
}

.form {
    padding: 18px 35px;
    user-select: none;
}

label {
    display: block;
    font-size: clamp(12px, 3.5vw, 13px);
    color: #555;
    margin-bottom: 6px;
    font-weight: 600;
    user-select: none;
}

input, select {
    width: 100%;
    height: 36px;
    padding: 8px 12px;
    border-radius: 2px;
    border: 1px solid #ddd;
    font-size: clamp(13px, 4vw, 14px);
    background-color: #fff;
    color: #000;
    user-select: text;
    margin-bottom: 12px;
}

.password-wrapper {
    position: relative;
    margin-bottom: 8px;
    user-select: none;
}

.show-hide {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: clamp(11px, 3vw, 12px);
    color: #005566;
    cursor: pointer;
    user-select: none;
    z-index: 1;
}

.error-message {
    color: red;
    font-size: clamp(11px, 3vw, 12px);
    margin-bottom: 8px;
    text-align: center;
    user-select: none;
}

.submit-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 12px;
    user-select: none;
}

button {
    background: #0088c0;
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 2px;
    font-weight: 700;
    font-size: clamp(13px, 4vw, 14px);
    cursor: pointer;
    user-select: none;
}

button:hover {
    background: #004a55;
}

.stay-signed {
    display: flex;
    align-items: center;
    gap: 6px;
    user-select: none;
}

.stay-signed input {
    width: 20px;
    height: 20px;
    margin: 0;
}

.stay-signed span {
    font-size: clamp(12px, 3.5vw, 13px);
    font-weight: normal;
    user-select: none;
}

.footer {
    border-top: 1px solid #ddd;
    background: #efefef;
    padding: 14px 35px;
    display: flex;
    gap: 12px;
    user-select: none;
}

.footer-select {
    flex: 1;
}

.footer-select label {
    font-size: clamp(11px, 3vw, 12px);
    color: #666;
    margin-bottom: 8px;
    display: block;
    user-select: none;
}

.footer-help div {
    width: 22px;
    height: 22px;
    border-radius: 11px;
    background: #111;
    color: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: clamp(11px, 3vw, 12px);
    user-select: none;
}

.spinner {
    display: none;
    justify-content: center;
    padding: 14px;
    user-select: none;
}

.spinner.active {
    display: flex;
}

.spinner div {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #005566;
    border-radius: 50%;
    width: 26px;
    height: 26px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.secure-content {
    padding: 18px 20px;
    text-align: center;
    user-select: none;
}

.secure-text {
    font-size: clamp(14px, 4.5vw, 15px);
    color: #4a4a4a;
    margin: 20px 0 0;
    user-select: none;
}

.success-content {
    padding: 24px;
    text-align: center;
    user-select: none;
}

.success-message {
    font-size: clamp(18px, 5.5vw, 22px);
    font-weight: 700;
    margin-bottom: 12px;
    color: #333;
    user-select: none;
}

.success-check {
    font-size: clamp(30px, 9vw, 36px);
    color: green;
    user-select: none;
}

.success-redirect {
    margin-top: 8px;
    color: #666;
    font-size: clamp(13px, 4vw, 14px);
    user-select: none;
}

.footer-text {
    border-top: 1px solid #ddd;
    background: #efefef;
    padding: 14px;
    font-size: clamp(11px, 3vw, 12px);
    color: #666;
    text-align: center;
    user-select: none;
}

.copyright {
    position: absolute;
    bottom: 0;
    width: 100%;
    font-size: clamp(10px, 2.5vw, 11px);
    color: #fff;
    text-align: center;
    padding: 10px 0;
    background: none;
    user-select: none;
}

.flex-gap {
    display: flex;
    gap: 10px;
    user-select: none;
}

.flex-1 { flex: 1; }
.width-110 { width: 200px; }

a {
    color: #005566;
    text-decoration: none;
    user-select: none;
}

a:hover {
    text-decoration: underline;
}

@media (max-width: 390px) {
    .submit-wrapper {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }

    .stay-signed {
        width: 100%;
        justify-content: center;
    }

    .width-110 {
        width: 100%;
    }
}
