*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
    background: #6b7280;
    color: #2c3e50;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    box-sizing: border-box;
    position: relative;
    overflow-x: hidden;
}

/* Geometrické pozadí s tvary podobnými originálu */
body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        linear-gradient(135deg, transparent 40%, rgba(75, 85, 99, 0.3) 40%, rgba(75, 85, 99, 0.3) 60%, transparent 60%),
        linear-gradient(45deg, transparent 30%, rgba(87, 97, 112, 0.2) 30%, rgba(87, 97, 112, 0.2) 70%, transparent 70%),
        linear-gradient(-45deg, transparent 20%, rgba(100, 112, 128, 0.15) 20%, rgba(100, 112, 128, 0.15) 80%, transparent 80%),
        linear-gradient(90deg, rgba(65, 75, 89, 0.1) 0%, transparent 50%, rgba(65, 75, 89, 0.1) 100%);
    pointer-events: none;
    z-index: 1;
}

/* Dodatečné geometrické tvary */
body::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        polygon(0 0, 100% 0, 80% 100%, 0 80%),
        polygon(20% 0, 100% 20%, 100% 100%, 0 100%);
    background-color: rgba(55, 65, 81, 0.1);
    clip-path: polygon(0 0, 100% 0, 90% 100%, 0 90%);
    pointer-events: none;
    z-index: 1;
}

h1 {
    text-align: center;
    color: #ffffff;
    margin-bottom: 24px;
    font-size: clamp(1.8rem, 4vw, 2.2rem);
    font-weight: 800;
    min-height: 2.8rem;
    line-height: 1.2;
    z-index: 10;
    position: relative;
    letter-spacing: -1px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.login-container {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: clamp(32px, 5vw, 48px) clamp(28px, 4vw, 40px);
    border-radius: 8px;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.15),
        0 8px 25px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 380px;
    min-width: 320px;
    box-sizing: border-box;
    animation: fadeIn 0.6s ease-in-out;
    margin: 0 auto;
    position: relative;
    z-index: 10;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

@keyframes fadeIn {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Logo kontejner */
.logo-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
    min-height: 60px;
}

.logo-container img {
    max-width: 150px;
    max-height: 60px;
    width: auto;
    height: auto;
    object-fit: contain;
}

/* CSS logo background varianta */
.logo-css {
    width: 150px;
    height: 60px;
    background: url('logo-agrofert.png') no-repeat center center;
    background-size: contain;
    margin: 0 auto 20px;
}

/* Fallback pokud není logo */
.logo-placeholder {
    width: 120px;
    height: 40px;
    background: linear-gradient(45deg, #4a9d6f, #2d7a5a);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
}

.login-container h2 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 32px;
    font-size: clamp(1.2rem, 3vw, 1.4rem);
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.3px;
}

form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

label {
    font-size: clamp(0.85rem, 2vw, 0.9rem);
    font-weight: 500;
    color: #5a6c7d;
    display: block;
    margin-bottom: 6px;
}

.input-wrapper {
    position: relative;
}

input[type="text"],
input[type="password"],
input[type="email"] {
    padding: clamp(14px, 2.5vw, 16px);
    border: 1px solid #d1d5db;
    border-radius: 4px;
    background: #ffffff;
    color: #2c3e50;
    font-weight: 400;
    transition: all 0.2s ease;
    width: 100%;
    box-sizing: border-box;
    min-height: 44px;
    font-family: inherit;
    font-size: 14px;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus {
    border-color: #1e293b;
    outline: none;
    box-shadow: 0 0 0 2px rgba(74, 157, 111, 0.2);
}

input::placeholder {
    color: #9ca3af;
    font-weight: 400;
}

.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    min-height: 36px;
    transition: color 0.2s ease;
}

.password-toggle:hover {
    color:  rgb(45, 84, 214);
}

.password-toggle:focus {
    outline: 2px solid rgb(53, 100, 255);
    outline-offset: 2px;
}

.password-toggle svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
}

/* Checkbox styl */
input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin-right: 8px;
    accent-color: #4a9d6f;
}

.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 8px 0;
}

.checkbox-wrapper label {
    margin: 0;
    font-size: 14px;
    color: #6b7280;
    cursor: pointer;
}

button {
    padding: clamp(14px, 2.5vw, 16px);
    background: linear-gradient(135deg, #7e81fa, rgb(53, 100, 255));
    color: #FFFFFF;
    border: none;
    border-radius: 4px;
    font-size: clamp(0.9rem, 2vw, 1rem);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 48px;
    position: relative;
    overflow: hidden;
    font-family: inherit;
    letter-spacing: 0.3px;
    text-transform: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

button[type="submit"]:hover {
    background: linear-gradient(135deg, #5a5cf5, rgb(45, 84, 214));
    box-shadow: 0 4px 12px rgba(74, 157, 111, 0.3);
}

button[type="submit"]:active {
    transform: translateY(0);
}

button[type="submit"]:focus {
    outline: none;
}


button:hover::after {
    transform: translateX(2px);
}

.error-message {
    color: #dc2626;
    background: rgba(220, 38, 38, 0.1);
    border: 1px solid rgba(220, 38, 38, 0.2);
    padding: 12px 16px;
    border-radius: 4px;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 16px;
    line-height: 1.4;
}


.success-message {
    color: #16a34a;
    background: rgba(22, 163, 74, 0.1);
    border: 1px solid rgba(22, 163, 74, 0.2);
    padding: 12px 16px;
    border-radius: 4px;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 16px;
    line-height: 1.4;
}

.footer {
    margin-top: 24px;
    font-size: 12px;
    color: black;
    text-align: center;
    line-height: 1.4;
    z-index: 10;
    position: relative;
}

.footer a {
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer a:hover {
    text-decoration: underline;
}

.help-info {
    margin-bottom: 16px;
    padding: 12px;
    background-color: rgba(74, 157, 111, 0.1);
    border-radius: 4px;
    border: 1px solid rgba(74, 157, 111, 0.2);
}

.help-info a {
    color: #4a9d6f;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.help-info a:hover {
    text-decoration: underline;
    color: #2d7a5a;
}

/* Jazykový přepínač */
.language-switcher {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.language-switcher:hover {
    background: rgba(255, 255, 255, 1);
}

/* Responzivní breakpointy */
@media (max-width: 768px) {
    body {
        padding: 1rem;
    }
    
    .login-container {
        max-width: 100%;
        margin: 1rem 0;
    }
    
    h1 {
        margin-bottom: 16px;
    }
    
    .login-container h2 {
        margin-bottom: 24px;
    }
    
    form {
        gap: 16px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 0.5rem;
    }
    
    .login-container {
        padding: 24px 20px;
        border-radius: 6px;
    }
    
    .password-toggle {
        right: 10px;
        padding: 6px;
        min-width: 32px;
        min-height: 32px;
    }
    
    .password-toggle svg {
        width: 16px;
        height: 16px;
    }
}

@media (max-width: 320px) {
    .login-container {
        padding: 20px 16px;
        min-width: 280px;
    }
    
    form {
        gap: 14px;
    }
    
    .footer {
        margin-top: 20px;
    }
}

/* Orientace na výšku pro mobilní zařízení */
@media (max-height: 600px) and (orientation: landscape) {
    body {
        justify-content: flex-start;
        padding-top: 1rem;
    }
    
    h1 {
        margin-bottom: 12px;
    }
    
    .login-container {
        margin: 0.5rem 0;
        padding: 20px;
    }
    
    .login-container h2 {
        margin-bottom: 16px;
    }
    
    form {
        gap: 12px;
    }
    
    .footer {
        margin-top: 16px;
    }
}

/* Zvýšení kontrastu pro lepší přístupnost */
@media (prefers-contrast: high) {
    input[type="text"],
    input[type="password"],
    input[type="email"] {
        border-width: 2px;
        background: white;
    }
    
    .login-container {
        background: rgba(255, 255, 255, 1);
        border: 2px solid rgba(0, 0, 0, 0.1);
    }
    
    button {
        border: 2px solid transparent;
    }
}

/* Redukce animací pro uživatele s preferencí */
@media (prefers-reduced-motion: reduce) {
    .login-container {
        animation: none;
    }
    
    * {
        transition: none !important;
        animation: none !important;
    }
    
    button[type="submit"]:hover,
    input:focus,
    .password-toggle:hover {
        transform: none !important;
    }
}