
:root {
    color-scheme: light;
    box-sizing: border-box;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    min-height: 100vh;
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.43;
    color: #333;
    background: #fff;
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

.wrap {
    width: 100%;
    max-width: 1140px;
    margin: 0 auto;
    padding: 100px 15px;
}

.panel {
    width: 416px;
    max-width: 100%;
    margin: 30px auto 0;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.panel-head {
    padding: 16px 15px;
    background: #f5f5f5;
    border-bottom: 1px solid #ddd;
    border-radius: 5px 5px 0 0;
    text-align: center;
    font-size: 16px;
    font-weight: 700;
}

.panel-body {
    padding: 25px 20px 30px;
}

.row {
    display: grid;
    grid-template-columns: 90px minmax(0, 1fr);
    column-gap: 16px;
    align-items: center;
    margin-bottom: 20px;
}

.row > label {
    font-weight: 700;
    text-align: right;
}

.row input[type="email"],
.password-wrap input[type="password"],
.password-wrap input[type="text"] {
    width: 100%;
    height: 38px;
    padding: 8px 12px;
    font: inherit;
    color: #555;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 4px;
    outline: none;
    box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.06);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.row input:focus {
    border-color: #66afe9;
    box-shadow: 0 0 7px rgba(102, 175, 233, 0.45);
}

.row input::placeholder {
    color: #aaa;
}

/* Password field */

.password-wrap {
    position: relative;
    width: 100%;
    min-width: 0;
}

.password-wrap input {
    padding-right: 45px !important;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 5px;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    color: #777;
    background: transparent;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.password-toggle:hover {
    color: #3276b1;
    background: #f1f5f9;
}

.password-toggle:focus-visible {
    outline: 2px solid #66afe9;
    outline-offset: 1px;
}

.password-toggle svg {
    display: block;
    flex-shrink: 0;
}

/* Login button */

.actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 25px;
}

.btn {
    display: inline-block;
    padding: 8px 18px;
    color: #fff;
    background: #428bca;
    border: 1px solid #357ebd;
    border-radius: 4px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.5;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.btn:hover {
    background: #3276b1;
    border-color: #285e8e;
}

.btn:focus-visible {
    outline: 2px solid #66afe9;
    outline-offset: 2px;
}

/* Django messages */

.message {
    padding: 10px 12px;
    margin: 0 0 18px;
    border: 1px solid transparent;
    border-radius: 4px;
    overflow-wrap: anywhere;
}

.message.error {
    color: #a94442;
    padding-left: 6.5rem;
}

.message.success {
    color: #3c763d;
    padding-left: 6.5rem;
}

.message.warning {
    color: #8a6d3b;
    padding-left: 6.5rem;
}

.message.info {
    color: #31708f;
    padding-left: 6.5rem;
}

/* Responsive layout */

@media (max-width: 560px) {
    .wrap {
        padding: 40px 15px;
    }

    .panel {
        margin: 15px auto 0;
    }

    .panel-body {
        padding: 22px 16px;
    }

    .row {
        grid-template-columns: 1fr;
        row-gap: 7px;
    }

    .row > label {
        text-align: left;
    }

    .actions {
        justify-content: flex-start;
    }
}
