/*
 Theme Name:   GeneratePress Child
 Theme URI:    https://generatepress.com
 Description:  Default GeneratePress child theme
 Author:       Tom Usborne
 Author URI:   https://tomusborne.com
 Template:     generatepress
 Version:      0.1
*/

/* ====================================
   Custom WordPress Login Page Styles
   ==================================== */

/* Root variables for easy future editing */
:root {
  --color-bg: #fff;
  --color-accent: #262626;
  --color-accent-dark: #171717;
  --color-border: #ddd;
  --color-error: #dc3232;
  --color-success: #46b450;
  --color-input: #111;
  --color-link: #111;
  --color-link-hover: #262626;
}

@font-face {
  font-family: 'Nokora';
  src: url('https://padangmedia.com/wp-content/uploads/generatepress/fonts/nokora/nokora-v33-latin-regular.woff2') format('woff2');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

/* Reset & main layout */
body.login {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  margin: 0;
  padding: 0;
  background-color: var(--color-bg);
  font-family: 'Nokora', "Segoe UI", sans-serif;
}

/* Container */
.login #login {
  width: 20rem;
  padding: 8% 0 0;
  margin: auto;
}

/* ====================================
   Custom Logo Styling
   ==================================== */
.login h1 {
  text-align: center;
  margin-bottom: 1.5rem;
}

.login h1 a,
#login h1 a {
  background-image: url('/wp-content/uploads/2025/08/padang-media-flat-logo.webp');
  background-size: 15rem 2.625rem;
  background-repeat: no-repeat;
  background-position: center;
  color: transparent;
  height: 2.625rem;
  width: 15rem;
  margin: 0 auto;
  padding: 0;
  display: block;
  overflow: hidden;
  border: 0;
  text-indent: -9999px; /* still widely used for WP logo */
}

.login h1 a:focus,
.login h1 a:hover {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* ====================================
   Form Styling
   ==================================== */
.login form {
  margin-top: 1.25rem;
  padding: 1.625rem 1.5rem 2.875rem;
  font-weight: 400;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 0.5rem;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* Input fields */
.login .input,
.login input[type="text"],
.login input[type="password"],
.login input[type="email"] {
  font-size: 1rem;
  width: 100%;
  border: 1px solid var(--color-input);
  border-radius: 0.25rem;
  padding: 0.75rem 1rem;
  margin: 0 0 1rem 0;
  background: var(--color-bg);
  box-shadow: inset 0 2px 4px rgba(255,255,255,0.2);
  transition: border-color 0.3s, box-shadow 0.3s;
  box-sizing: border-box;
}

/* Improve focus accessibility */
.login .input:focus,
.login input[type="text"]:focus,
.login input[type="password"]:focus,
.login input[type="email"]:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 2px rgba(38,38,38,0.1);
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* Labels */
.login form label {
  color: var(--color-input);
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  display: block;
}

/* Submit button */
.login .button-primary {
  background-color: var(--color-accent) !important;
  border: 1px solid var(--color-accent) !important;
  border-radius: 0.25rem;
  color: #fff !important;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1;
  padding: 0.75rem 1.5rem;
  text-decoration: none;
  transition: all 0.3s;
  width: 100%;
  margin-top: 0.625rem;
}

.login .button-primary:hover,
.login .button-primary:focus {
  background-color: var(--color-accent-dark) !important;
  border-color: var(--color-accent-dark) !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.15) !important;
}

.login .button-primary:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(0,0,0,0.1) !important;
}

.login .button-primary:disabled {
  background-color: #ccc !important;
  border-color: #ccc !important;
  cursor: not-allowed;
  transform: none !important;
}

/* ====================================
   Checkbox and Remember Me
   ==================================== */
.login .forgetmenot {
  float: left;
  margin-bottom: 0;
}

.login .forgetmenot input[type="checkbox"] {
  margin-right: 0.5rem;
  width: 1.1em;
  height: 1.1em;
}

/* ====================================
   Links and Navigation
   ==================================== */
.login #nav,
.login #backtoblog {
  text-align: center;
  margin: 1rem 0;
}

.login #nav a,
.login #backtoblog a {
  color: var(--color-link) !important;
  text-decoration: none;
  font-size: 0.875rem;
  transition: color 0.3s;
}

.login #nav a:hover,
.login #backtoblog a:hover,
.login #nav a:focus,
.login #backtoblog a:focus {
  color: var(--color-link-hover) !important;
  text-decoration: underline;
}

/* ====================================
   Error & Message Styling
   ==================================== */
.login #login_error,
.login .message,
.login .success {
  border-left: 4px solid var(--color-error);
  padding: 0.75rem;
  margin-bottom: 1.25rem;
  background: var(--color-bg);
  border-radius: 0.25rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  font-size: 0.95rem;
}
.login .message,
.login .success {
  border-left-color: var(--color-success);
}

/* Accessibility: visually hidden helper */
.screen-reader-text {
  position: absolute !important;
  width: 1px; height: 1px; padding: 0;
  margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); border: 0;
}

/* ====================================
   Responsive Design
   ==================================== */
@media (max-width: 30em) {
  .login #login {
    width: 95%;
    margin: 0 auto;
  }
  .login h1 a,
  #login h1 a {
    width: 12.5rem;
    height: 2.2rem;
    background-size: 12.5rem 2.2rem;
  }
  .login form {
    padding: 1.1rem 1rem 2rem;
  }
  .login .input,
  .login input[type="text"],
  .login input[type="password"],
  .login input[type="email"] {
    font-size: 1rem;
  }
}

/* ====================================
   User preferences: Accessibility
   ==================================== */
@media (prefers-contrast: high) {
  .login form,
  .login .input,
  .login input[type="text"],
  .login input[type="password"],
  .login input[type="email"] {
    border: 2px solid #000;
  }
}

@media (prefers-reduced-motion: reduce) {
  .login .button-primary,
  .login .input,
  .login input[type="text"],
  .login input[type="password"],
  .login input[type="email"],
  .login #nav a,
  .login #backtoblog a {
    transition: none !important;
  }
}
