/* Fail: /htdocs/assets/css/style.css */

/* --- 1. PÕHISEADED --- */
:root {
    --primary-color: #008080; /* Teal */
    --primary-dark: #006666;
    --accent-color: #e0f2f1;
    --text-color: #333;
    --bg-color: #f4f7f6;
    --white: #ffffff;
    --input-border: #ccc;
    --radius: 8px;
}

* {
    box_sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    
    /* See on kriitiline Sisselogimise jaoks: */
    display: flex;
    justify-content: center; /* Horisontaalselt keskele */
    align-items: center;     /* Vertikaalselt keskele */
    min-height: 100vh;
    width: 100%;
    
    /* NB! Admin vaates kirjutame selle üle, aga Loginis on seda vaja */
}

/* --- 2. SISSELOGIMISE VAADE --- */

.login-container {
    background-color: var(--white);
    padding: 40px 30px;
    border-radius: var(--radius);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    
    /* Suuruse reeglid */
    width: 100%;
    max-width: 400px; /* Ei lase desktopis liiga laiaks */
    margin: 20px;     /* Et mobiilis ei oleks servas kinni */
    
    text-align: center;
    position: relative;
    z-index: 10;
}

.logo-img {
    max-width: 180px; /* Piirame logo suurust */
    height: auto;
    margin-bottom: 25px;
}

h2 {
    margin-bottom: 20px;
    color: var(--primary-dark);
    font-weight: 600;
}

/* Vormid */
.form-group {
    margin-bottom: 15px;
    text-align: left;
}

label {
    display: block;
    margin-bottom: 5px;
    font-size: 0.9rem;
    color: #666;
    font-weight: 500;
}

input[type="email"],
input[type="password"],
input[type="text"] {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--input-border);
    border-radius: var(--radius);
    font-size: 16px;
    transition: border 0.3s;
}

input:focus {
    border-color: var(--primary-color);
    outline: none;
}

/* Nupud */
.btn {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: var(--radius);
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    margin-bottom: 10px;
    transition: background 0.3s, transform 0.2s;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn:active { transform: scale(0.98); }

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}
.btn-primary:hover { background-color: var(--primary-dark); }

.divider {
    margin: 20px 0;
    border-top: 1px solid #eee;
    position: relative;
}
.divider span {
    background: var(--white);
    padding: 0 10px;
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    color: #999;
    font-size: 12px;
}

/* ID Nupud */
.btn-smartid { background: #fff; border: 2px solid #333; color: #333; }
.btn-mobileid { background: #fff; border: 2px solid #007bff; color: #007bff; }

.auth-links { margin-top: 15px; font-size: 0.9rem; }
.auth-links a { color: var(--primary-color); text-decoration: none; }
.auth-links a:hover { text-decoration: underline; }

.alert {
    padding: 10px;
    background-color: #f8d7da;
    color: #721c24;
    border-radius: var(--radius);
    margin-bottom: 15px;
    font-size: 0.9rem;
}


/* --- 3. ADMIN LAYOUT (Override) --- */

.admin-layout {
    display: flex;
    min-height: 100vh;
    width: 100%;
    background-color: #f4f7f6;
    
    /* See on oluline! Admin layout võtab juhtimise üle body flexboxilt */
    flex-direction: row; 
    align-items: stretch;
}

/* Külgmenüü */
.admin-sidebar {
    width: 250px;
    background-color: #2c3e50;
    color: #ecf0f1;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    transition: transform 0.3s ease-in-out;
    z-index: 1000;
}

.sidebar-header {
    padding: 20px;
    background-color: #1a252f;
    text-align: center;
}

.sidebar-menu { flex-grow: 1; padding-top: 20px; }
.sidebar-menu a {
    display: block;
    padding: 15px 25px;
    color: #bdc3c7;
    text-decoration: none;
    transition: 0.2s;
    border-left: 4px solid transparent;
}
.sidebar-menu a:hover, .sidebar-menu a.active {
    background-color: #34495e;
    color: #fff;
    border-left-color: var(--primary-color);
}
.sidebar-menu i { margin-right: 10px; width: 20px; text-align: center; }

/* Põhisisu */
.admin-main {
    flex-grow: 1;
    margin-left: 250px; /* Desktop shift */
    display: flex;
    flex-direction: column;
    width: calc(100% - 250px);
}

.admin-topbar {
    background: #fff;
    height: 70px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 900;
}

.hamburger-btn {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #333;
}

.admin-content {
    padding: 30px;
    overflow-x: hidden;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 999;
}

/* --- 4. MOBIILIVAADE --- */
@media (max-width: 768px) {
    /* Admin */
    .admin-sidebar { transform: translateX(-100%); }
    .admin-sidebar.active { transform: translateX(0); }
    .admin-main { margin-left: 0; width: 100%; }
    .hamburger-btn { display: block; }
    .sidebar-overlay.active { display: block; }
    .desktop-only { display: none; }
    
    /* Login */
    .login-container {
        padding: 30px 20px;
        margin: 15px; /* Väiksem äär telefonis */
        width: calc(100% - 30px);
    }
}