/* Self Service Password - Modern & Professional Design */

/* Body & Background */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Container */
.container {
    position: relative;
    z-index: 1;
}

/* Card - Clean White Design */
.card {
    border-radius: 20px !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3) !important;
    border: none !important;
    background: #ffffff !important;
    overflow: hidden;
}

/* Card Header - Extra Compact */
.card-header {
    background: #ffffff !important;
    border: none !important;
    padding: 0.75rem 1.25rem 0.5rem !important;
    text-align: center;
    border-radius: 20px 20px 0 0 !important;
}

.card-header img {
    max-height: 45px !important;
    width: auto !important;
    margin-bottom: 0.25rem;
    display: inline-block;
}

.card-header h1,
.card-header .h1 {
    font-size: 1rem !important;
    font-weight: 600 !important;
    color: #2c3e50 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

/* Card Body - Single Column Vertical Layout */
.card-body {
    padding: 0.75rem 1.25rem 1rem !important;
    background: #ffffff;
    display: block;
}

/* Info/Alerts di atas */
.card-body>.alert,
.card-body>p,
.card-body>div:not(:has(form)) {
    margin-bottom: 0.75rem;
}

/* Form di bawah */
.card-body>form {
    margin-top: 0.5rem;
}

/* Form Controls - Extra Compact */
.form-control,
.form-select,
input[type="text"],
input[type="password"],
input[type="email"] {
    padding: 0.45rem 0.65rem !important;
    font-size: 0.85rem !important;
    border-radius: 5px !important;
    border: 1px solid #e1e8ed !important;
    background: #f8f9fa !important;
    transition: all 0.3s ease !important;
    color: #2c3e50 !important;
}

.form-control:focus,
.form-select:focus,
input:focus {
    border-color: #3498db !important;
    background: #ffffff !important;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.1) !important;
    outline: none !important;
}

/* Labels - Compact */
label {
    font-weight: 600 !important;
    color: #2c3e50 !important;
    margin-bottom: 0.25rem !important;
    font-size: 0.85rem !important;
    display: block;
}

/* Form Groups - Reduced margin */
.form-group,
.mb-3 {
    margin-bottom: 0.75rem !important;
}

/* Buttons - Extra Compact */
.btn {
    padding: 0.5rem 1rem !important;
    font-size: 0.85rem !important;
    font-weight: 600 !important;
    border-radius: 5px !important;
    border: none !important;
    transition: all 0.3s ease !important;
    cursor: pointer;
}

.btn-primary {
    background: #3498db !important;
    color: white !important;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.4) !important;
}

.btn-primary:hover {
    background: #2980b9 !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(52, 152, 219, 0.5) !important;
}

.btn-success {
    background: #27ae60 !important;
    color: white !important;
    box-shadow: 0 4px 12px rgba(39, 174, 96, 0.4) !important;
}

.btn-success:hover {
    background: #229954 !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(39, 174, 96, 0.5) !important;
}

.btn-secondary {
    background: #95a5a6 !important;
    color: white !important;
}

.btn-secondary:hover {
    background: #7f8c8d !important;
    transform: translateY(-2px);
}

/* Alerts - Extra Compact */
.alert {
    border-radius: 5px !important;
    border: none !important;
    padding: 0.5rem 0.75rem !important;
    margin-bottom: 0.5rem !important;
    font-size: 0.8rem !important;
}

.alert-success {
    background-color: #d4edda !important;
    color: #155724 !important;
}

.alert-danger {
    background-color: #f8d7da !important;
    color: #721c24 !important;
}

.alert-info {
    background-color: #d1ecf1 !important;
    color: #0c5460 !important;
}

/* Password policy display */
.password-policy {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1rem;
    font-size: 0.9rem;
}

.password-policy ul {
    margin-bottom: 0;
    padding-left: 1.5rem;
}

.password-policy li {
    margin-bottom: 0.5rem;
}

/* Links - Blue Theme */
a {
    color: #3498db !important;
    text-decoration: none !important;
    font-weight: 500;
    transition: color 0.3s ease;
}

a:hover {
    color: #2980b9 !important;
    text-decoration: underline !important;
}

/* List Group Items (Menu) */
.list-group-item {
    border: none !important;
    border-bottom: 1px solid #e1e8ed !important;
    padding: 1rem 1.25rem !important;
    transition: all 0.3s ease;
    background: #ffffff;
}

.list-group-item:hover {
    background: #f8f9fa !important;
    padding-left: 1.5rem !important;
}

.list-group-item:last-child {
    border-bottom: none !important;
}

.list-group-item a {
    display: block;
    color: #2c3e50 !important;
    font-weight: 500;
}

.list-group-item:hover a {
    color: #3498db !important;
}

/* CAPTCHA container */
.captcha-container {
    margin: 1.5rem 0;
    display: flex;
    justify-content: center;
}

/* Hide entire login field row - user only needs to enter email */
#login,
label[for="login"],
input[name="login"] {
    display: none !important;
}

/* Hide the entire row containing login field */
.row.mb-3:has(#login),
.row:has(input[name="login"]) {
    display: none !important;
}

/* Fix mail field layout - match captcha structure exactly */
.row:has(input[name="mail"]) {
    display: flex !important;
    flex-wrap: wrap !important;
    margin-bottom: 0.75rem !important;
}

/* Hide the col-sm-4 (label column) completely */
.row:has(input[name="mail"]) .col-sm-4 {
    display: none !important;
}

/* Make col-sm-8 full width when col-sm-4 is hidden */
.row:has(input[name="mail"]) .col-sm-8 {
    flex: 0 0 100% !important;
    max-width: 100% !important;
}

/* Ensure input-group and input take full width */
.row:has(input[name="mail"]) .input-group {
    display: flex !important;
    width: 100% !important;
}

.row:has(input[name="mail"]) input[name="mail"] {
    flex: 1 !important;
}

/* Ensure mail field and its row are visible */
input[name="mail"],
label[for="mail"] {
    display: block !important;
    visibility: visible !important;
}

/* Desktop optimizations - Single Column */
@media (min-width: 769px) {
    .container {
        max-width: 600px !important;
        margin: 0 auto !important;
        padding: 0.5rem !important;
    }

    .card {
        margin: 0 auto !important;
    }

    body {
        padding: 0.5rem 0 !important;
    }

    .btn {
        min-width: 110px !important;
    }

    .card-body {
        padding: 1rem 2rem 1.25rem !important;
    }

    .card-header {
        padding: 0.875rem 1.5rem 0.5rem !important;
    }

    .card-header img {
        max-height: 50px !important;
    }

    .card-header h1,
    .card-header .h1 {
        font-size: 1rem !important;
    }
}

/* Tablet & Mobile Responsive - Single Column */
@media (max-width: 768px) {
    body {
        background-attachment: scroll;
    }

    .card {
        margin: 1rem !important;
        border-radius: 10px !important;
    }

    .card-header {
        padding: 1rem !important;
        border-radius: 10px 10px 0 0 !important;
    }

    .card-body {
        padding: 1rem !important;
    }

    .card-header img {
        max-height: 60px !important;
    }

    .form-control,
    .form-select {
        padding: 0.75rem 1rem !important;
        font-size: 1rem !important;
    }

    .btn {
        width: 100% !important;
        margin-bottom: 0.5rem !important;
        padding: 0.875rem !important;
        font-size: 1rem !important;
    }

    label {
        font-size: 0.95rem !important;
    }

    h1,
    .h1 {
        font-size: 1.5rem !important;
    }

    h2,
    .h2 {
        font-size: 1.3rem !important;
    }
}

@media (max-width: 480px) {
    .card {
        margin: 0.5rem !important;
    }

    .card-body {
        padding: 1rem 0.75rem !important;
    }

    .form-control,
    .form-select {
        font-size: 16px !important;
        /* Prevent zoom on iOS */
    }
}

/* Touch device improvements */
@media (hover: none) and (pointer: coarse) {
    .btn {
        min-height: 48px;
        /* Better touch target */
    }

    .form-control,
    .form-select {
        min-height: 48px;
    }

    a {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
    }
}

/* Loading states */
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Input groups */
.input-group {
    margin-bottom: 1rem;
}

/* Help text */
.form-text {
    font-size: 0.875rem;
    color: #6c757d;
    margin-top: 0.5rem;
}

/* Container responsiveness */
.container {
    width: 100%;
    padding: 1rem;
}

/* Accessibility improvements */
*:focus {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

button:focus,
.btn:focus {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Better spacing */
.mb-3 {
    margin-bottom: 1.5rem !important;
}

/* Icon improvements if using icons */
.input-group-text {
    background-color: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-right: none;
    border-radius: 8px 0 0 8px;
}

.input-group .form-control {
    border-left: none;
    border-radius: 0 8px 8px 0;
}

/* Success checkmarks and error icons */
.form-control.is-valid {
    border-color: #28a745 !important;
}

.form-control.is-invalid {
    border-color: #dc3545 !important;
}