/* Fail: style.css (Uus versioon) */

/* Google Font */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');

/* Baasstiilid */
body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #f8f9fa;
    color: #343a40;
    line-height: 1.7;
    margin: 0;
    padding: 30px 20px;
}

.container {
    max-width: 600px;
    margin: 20px auto;
    padding: 40px;
    background-color: #ffffff;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.07);
    text-align: center;
}

/* Kangelase ikoon (sooduskood) */
.hero-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 15px auto;
    color: #007bff;
    /* Ikoon ise on 1.5 jämedusega, teeme siin 2x jämedamaks */
    stroke-width: 2; 
}
.hero-icon svg {
    width: 100%;
    height: 100%;
}

h1 {
    color: #212529;
    margin-top: 0;
    margin-bottom: 10px;
    font-weight: 700;
}

.subtitle {
    font-size: 1.1em;
    color: #495057;
    margin-bottom: 25px;
}

p {
    color: #495057;
    margin-bottom: 15px;
}

/* Sammude plokk */
.steps {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    margin: 30px 0;
    text-align: left;
    border: 1px solid #e9ecef;
}
.steps strong {
    font-size: 1.1em;
    font-weight: 600;
    color: #343a40;
}
.steps ol {
    padding-left: 25px;
    margin-top: 15px;
    margin-bottom: 15px;
}
.steps ol li {
    margin-bottom: 8px;
}
.steps p {
    margin-bottom: 0;
    font-weight: 500;
}


/* Vormi stiilid */
.discount-form {
    margin-top: 30px;
    text-align: left;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #343a40;
}

.input-wrapper {
    position: relative;
}

.form-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: #adb5bd;
    pointer-events: none; /* Ei sega hiirega klikkimist */
}

.form-group input[type="url"],
.form-group input[type="email"] {
    width: 100%;
    padding: 14px 14px 14px 50px; /* Vasakule ruum ikooni jaoks */
    border: 1px solid #ced4da;
    border-radius: 10px;
    box-sizing: border-box; 
    font-family: 'Poppins', sans-serif;
    font-size: 1em;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-group input[type="url"]:focus,
.form-group input[type="email"]:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.15);
    outline: none;
}

button[type="submit"] {
    background-color: #007bff;
    color: white;
    width: 100%;
    padding: 15px 20px;
    border: none;
    border-radius: 10px;
    font-size: 1.1em;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

button[type="submit"]:hover {
    background-color: #0056b3;
}
button[type="submit"]:active {
    transform: scale(0.99);
}

.privacy-note {
    font-size: 0.9em;
    color: #6c757d;
    margin-top: 25px;
    text-align: center;
}

/* Teated (ainult veateated) */
.message.error {
    background-color: #fdeaea;
    color: #c51f1a;
    border: 1px solid #f9c5c5;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 10px;
    text-align: left;
    font-weight: 500;
}

/* Keelevahetaja */
.lang-switcher {
    max-width: 600px;
    margin: 0 auto 10px auto;
    text-align: right;
    font-size: 0.9em;
    padding: 0 5px;
}
.lang-switcher a {
    color: #007bff;
    text-decoration: none;
    font-weight: 500;
}
.lang-switcher a:hover {
    text-decoration: underline;
}


/* === MODAALAKNA STIILID === */

/* Tume taust */
.modal-overlay {
    display: none; /* Vaikimisi peidus */
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    /* Uduse taustaefekti jaoks */
    backdrop-filter: blur(5px);
    
    /* Sisu keskele joondamiseks */
    align-items: center;
    justify-content: center;
    
    /* Animatsioon */
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Nähtav olek (lisatakse JS-iga) */
.modal-overlay.show {
    display: flex;
    opacity: 1;
}

/* Akna sisu */
.modal-content {
    background-color: #fff;
    border-radius: 16px;
    padding: 35px;
    max-width: 450px;
    width: 90%;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    text-align: center;
    
    /* Sissehüpamise animatsioon */
    transform: scale(0.9);
    transition: transform 0.3s ease;
}
.modal-overlay.show .modal-content {
    transform: scale(1);
}

.modal-icon {
    width: 70px;
    height: 70px;
    margin: 0 auto 20px auto;
    color: #28a745; /* Roheline */
    stroke-width: 2;
}
.modal-icon svg {
    width: 100%;
    height: 100%;
}

.modal-content h2 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #212529;
}

.modal-content p {
    color: #495057;
    margin-bottom: 10px;
}
.modal-content p:last-of-type {
    margin-bottom: 25px;
}

/* Modaalakna nupp */
.modal-button {
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 10px;
    padding: 12px 30px;
    font-size: 1em;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    transition: background-color 0.2s ease;
}
.modal-button:hover {
    background-color: #0056b3;
}

/* === Admini lehe stiilid (muutmata, aga siia kopeeritud, et kõik css oleks koos) === */
.admin-container {
    max-width: 1000px;
    text-align: left;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

table th, table td {
    padding: 12px;
    border: 1px solid #eee;
    text-align: left;
}

table th {
    background-color: #f9f9f9;
}

tr.pending {
    font-weight: 600;
    background-color: #fffde7;
}
tr.sent {
    background-color: #f0f0f0;
    color: #888;
}

.actions a {
    text-decoration: none;
    margin-right: 10px;
    font-size: 1.2em;
}
.action-btn.sent { color: green; }
.action-btn.pending { color: orange; }
.action-btn.delete { color: red; }

.lang-switcher.admin {
    max-width: 1000px;
}


/* === UUS OSA: Admini vormi stiilid tabeli sees === */

.actions .code-form {
    display: flex;
    align-items: center;
    gap: 5px;
}
.actions .code-form input[type="text"] {
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 0.9em;
    font-family: 'Poppins', sans-serif;
    width: 140px; /* Vajadusel muuda laiust */
    box-sizing: border-box;
}
.actions .code-form input[type="text"]:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.15);
    outline: none;
}
.actions .action-btn-submit {
    font-size: 1.4em;
    font-weight: 600;
    color: #007bff;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0 5px;
    text-decoration: none;
    font-family: 'Poppins', sans-serif;
}
.actions .action-btn-submit:hover {
    color: #0056b3;
}