/**
 * MasterGreen Login - Material Design Agriculture Theme
 * Redesigned: 2026
 */

/* ===== CSS Variables for Theme Colors ===== */
:root {
    --primary-green: #2e7d32;
    --primary-dark: #1b5e20;
    --primary-light: #4caf50;
    --accent-green: #8bc34a;
    --accent-lime: #c5e1a5;
    --surface-white: rgba(255, 255, 255, 0.95);
    --surface-glass: rgba(255, 255, 255, 0.85);
    --text-primary: #1a1a1a;
    --text-secondary: #5a5a5a;
    --text-light: #888888;
    --shadow-light: rgba(0, 0, 0, 0.08);
    --shadow-medium: rgba(0, 0, 0, 0.12);
    --shadow-strong: rgba(0, 0, 0, 0.24);
    --gradient-green: linear-gradient(135deg, #2e7d32 0%, #4caf50 50%, #8bc34a 100%);
    --gradient-dark: linear-gradient(135deg, #1b5e20 0%, #2e7d32 100%);
}

/* ===== Google Fonts Import ===== */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

/* ===== Base Styles ===== */
* {
    box-sizing: border-box;
}

html,
body {
    font-family: 'Poppins', 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 14px;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
}

/* ===== Background Styling ===== */
.background {
    background: url('../images/bg_agriculture.png');
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center center;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    animation: bgZoom 30s ease-in-out infinite alternate;
}

@keyframes bgZoom {
    0% {
        transform: scale(1);
    }

    100% {
        transform: scale(1.05);
    }
}

.backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg,
            rgba(27, 94, 32, 0.75) 0%,
            rgba(46, 125, 50, 0.6) 50%,
            rgba(139, 195, 74, 0.4) 100%);
    z-index: -1;
    backdrop-filter: blur(2px);
}

/* ===== Login Container ===== */
.login-container {
    max-width: 420px;
    width: 90%;
    z-index: 1;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    animation: slideUp 0.6s ease-out, fadeIn 0.8s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translate(-50%, -45%);
    }

    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* ===== Login Card ===== */
.login-header {
    text-align: center;
    padding: 35px 30px 25px;
    background: var(--gradient-green);
    border-radius: 16px 16px 0 0;
    position: relative;
    overflow: hidden;
}

.login-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 60%);
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {

    0%,
    100% {
        transform: translate(-30%, -30%);
    }

    50% {
        transform: translate(30%, 30%);
    }
}

.login-header img {
    max-width: 180px;
    max-height: 80px;
    object-fit: contain;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
    position: relative;
    z-index: 1;
}

.login-header h3 {
    font-weight: 500;
    font-size: 22px;
    margin: 15px 0 0;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
    position: relative;
    z-index: 1;
}

.login-body {
    padding: 35px 35px 25px;
    background: var(--surface-white);
    backdrop-filter: blur(10px);
}

/* ===== Form Inputs ===== */
.input-group {
    position: relative;
    margin-bottom: 24px !important;
}

.login-input,
.login-input:focus {
    border: none;
    border-bottom: 2px solid #e0e0e0;
    border-radius: 0;
    outline: none;
    box-shadow: none;
    padding: 12px 15px;
    font-size: 15px;
    background: transparent;
    transition: all 0.3s ease;
    font-family: 'Poppins', sans-serif;
}

.login-input:focus {
    border-bottom-color: var(--primary-green);
    background: rgba(46, 125, 50, 0.03);
}

.login-input::placeholder {
    color: var(--text-light);
    transition: all 0.3s ease;
}

.login-input:focus::placeholder {
    color: var(--primary-green);
    transform: translateY(-2px);
}

.input-group-prepend.login-input {
    border-bottom: 2px solid #e0e0e0;
    transition: all 0.3s ease;
}

.input-group:focus-within .input-group-prepend.login-input {
    border-bottom-color: var(--primary-green);
}

.login-container .input-group-text {
    background: none;
    border: 0;
    color: var(--text-light);
    padding: 12px 15px 12px 10px;
    transition: all 0.3s ease;
}

.input-group:focus-within .input-group-text {
    color: var(--primary-green);
}

.input-group-text i {
    font-size: 18px;
}

/* ===== Checkbox ===== */
.checkbox {
    margin-left: 5px;
}

.checkbox label {
    cursor: pointer;
    font-weight: 400 !important;
    color: var(--text-secondary);
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    user-select: none;
}

input[type=checkbox] {
    width: 20px;
    height: 20px;
    border: 2px solid #ccc;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    -webkit-appearance: none;
    appearance: none;
    position: relative;
}

input[type=checkbox]:checked {
    background: var(--primary-green);
    border-color: var(--primary-green);
}

input[type=checkbox]:checked::after {
    content: '\f00c';
    font-family: FontAwesome;
    color: white;
    font-size: 12px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

input[type=checkbox]:hover {
    border-color: var(--primary-light);
}

/* ===== Submit Button ===== */
.login-container .btn {
    height: auto;
    padding: 14px 28px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.login-container .btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.login-container .btn:active::before {
    width: 300px;
    height: 300px;
}

/* Button Colors - Material Design Green */
.btn.btn-primary,
.login-container .btn.btn-primary {
    background: var(--gradient-green);
    border: none;
    color: white;
    box-shadow: 0 4px 15px rgba(46, 125, 50, 0.35);
}

.btn.btn-primary:hover,
.login-container .btn.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(46, 125, 50, 0.45);
}

.btn.btn-primary:active {
    transform: translateY(0);
}

.btn.btn-success,
.login-container .btn.btn-success {
    background: var(--gradient-dark);
    border: none;
    color: white;
    box-shadow: 0 4px 15px rgba(27, 94, 32, 0.35);
}

.btn.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(27, 94, 32, 0.45);
}

.btn.btn-info,
.login-container .btn.btn-info {
    background: linear-gradient(135deg, #26a69a 0%, #4db6ac 100%);
    border: none;
    color: white;
    box-shadow: 0 4px 15px rgba(38, 166, 154, 0.35);
}

.btn.btn-info:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(38, 166, 154, 0.45);
}

.btn.btn-danger,
.login-container .btn.btn-danger {
    background: linear-gradient(135deg, #e53935 0%, #ef5350 100%);
    border: none;
    color: white;
    box-shadow: 0 4px 15px rgba(229, 57, 53, 0.35);
}

.btn.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(229, 57, 53, 0.45);
}

.btn.btn-warning,
.login-container .btn.btn-warning {
    background: linear-gradient(135deg, #ff9800 0%, #ffb74d 100%);
    border: none;
    color: #1a1a1a;
    box-shadow: 0 4px 15px rgba(255, 152, 0, 0.35);
}

.btn.btn-warning:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 152, 0, 0.45);
}

/* ===== Login Footer ===== */
.login-footer {
    background: #f8f9fa;
    text-align: center;
    padding: 20px 30px;
    border-radius: 0 0 16px 16px;
    border-top: 1px solid #e8e8e8;
}

.login-footer p {
    margin-bottom: 8px;
    font-size: 13px;
    color: var(--text-secondary);
}

.login-footer p:last-child {
    margin-bottom: 0;
}

.login-footer a {
    color: var(--primary-green);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
}

.login-footer a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* ===== Copyright ===== */
.login-container .copyright {
    background: none;
    color: rgba(255, 255, 255, 0.85);
    text-align: center;
    margin-top: 20px;
    font-size: 13px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.login-container .copyright a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    transition: color 0.2s ease;
}

.login-container .copyright a:hover {
    color: white;
    text-decoration: underline;
}

/* ===== Alert Messages ===== */
.alert {
    border-radius: 8px;
    border: none;
    padding: 14px 18px;
    margin-bottom: 20px;
    font-size: 14px;
    box-shadow: 0 2px 8px var(--shadow-light);
}

.alert-danger {
    background: linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%);
    color: #c62828;
    border-left: 4px solid #e53935;
}

.alert-success {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    color: #2e7d32;
    border-left: 4px solid #4caf50;
}

.alert-warning {
    background: linear-gradient(135deg, #fff8e1 0%, #ffe082 100%);
    color: #e65100;
    border-left: 4px solid #ff9800;
}

.alert-info {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    color: #1565c0;
    border-left: 4px solid #2196f3;
}

/* ===== Form Controls ===== */
.form-control {
    border-radius: 8px;
    font-family: 'Poppins', sans-serif;
}

.form-control:focus {
    border-color: var(--primary-green);
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.15);
}

/* ===== Progress Bar ===== */
.progress {
    border-radius: 8px;
    height: 8px;
    background: #e0e0e0;
    overflow: hidden;
}

.progress-bar {
    background: var(--gradient-green);
}

/* ===== Loader Shimmer Effect ===== */
@keyframes buttonShimmer {
    0% {
        background-position: -200% center;
    }

    100% {
        background-position: 200% center;
    }
}

.btn.loading {
    background-size: 200% 100%;
    animation: buttonShimmer 1.5s linear infinite;
}

/* ===== Responsive Design ===== */
@media screen and (max-width: 500px) {

    html,
    body {
        overflow-x: hidden;
        width: 100%;
        min-height: 100vh;
    }

    body {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        padding-top: 30px;
        padding-bottom: 30px;
    }

    .background,
    .backdrop {
        width: 100%;
        max-width: 100vw;
    }

    .login-container {
        width: calc(100% - 40px) !important;
        max-width: 380px !important;
        position: static !important;
        transform: none !important;
        left: auto !important;
        right: auto !important;
        top: auto !important;
        bottom: auto !important;
        margin: 0 auto !important;
        display: block !important;
    }

    .login-header {
        padding: 25px 20px 18px;
        border-radius: 12px 12px 0 0;
    }

    .login-header img {
        max-width: 140px;
    }

    .login-body {
        padding: 25px 20px;
        border-radius: 0 0 12px 12px;
    }

    .login-container .btn {
        padding: 12px 20px;
        font-size: 15px;
    }

    input,
    select {
        max-width: 100% !important;
        width: 100% !important;
        float: none;
    }

    .input-group {
        width: 100%;
        flex-wrap: nowrap;
    }

    .form-control {
        min-width: 0;
    }

    .copyright {
        position: static;
        margin-top: 15px;
    }
}

@media screen and (max-height: 700px) {
    .login-container {
        top: auto;
        transform: translateX(-50%);
        margin: 30px auto;
    }
}

/* ===== Focus visible for accessibility ===== */
:focus-visible {
    outline: 2px solid var(--primary-green);
    outline-offset: 2px;
}

/* ===== Form Labels ===== */
label {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 6px;
}

/* ===== Small Alerts ===== */
small.alert {
    padding: 8px 12px;
    display: block;
    margin: 5px 0 0;
    border-radius: 6px;
    font-size: 13px;
}

/* ===== Inline Form ===== */
.form-inline input:not(:last-child),
.form-inline select:not(:last-child) {
    margin-right: 10px;
}

/* ===== Additional Beautification ===== */
::selection {
    background: var(--accent-lime);
    color: var(--primary-dark);
}

/* Smooth scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-light);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-green);
}